<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: arabind kumar</title>
    <description>The latest articles on DEV Community by arabind kumar (@arabind_kumar_429558888b9).</description>
    <link>https://dev.to/arabind_kumar_429558888b9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4156772%2Fdb9e1414-5980-43ad-a3a1-48a6448f3331.jpg</url>
      <title>DEV Community: arabind kumar</title>
      <link>https://dev.to/arabind_kumar_429558888b9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arabind_kumar_429558888b9"/>
    <language>en</language>
    <item>
      <title>Your shapefile is in the wrong place? Measure how far off it is</title>
      <dc:creator>arabind kumar</dc:creator>
      <pubDate>Fri, 02 Oct 2026 08:47:56 +0000</pubDate>
      <link>https://dev.to/arabind_kumar_429558888b9/your-shapefile-is-in-the-wrong-place-measure-how-far-off-it-is-548o</link>
      <guid>https://dev.to/arabind_kumar_429558888b9/your-shapefile-is-in-the-wrong-place-measure-how-far-off-it-is-548o</guid>
      <description>&lt;p&gt;You load a shapefile and your data shows up in the ocean, in the wrong country, or just slightly off the road it should sit on. The data is almost never "broken". It is a coordinate system problem, and the good news is that &lt;strong&gt;the distance your data is off by usually tells you which problem it is.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  First, the one idea that fixes most cases
&lt;/h2&gt;

&lt;p&gt;Every coordinate is just a pair of numbers. The coordinate reference system (CRS) tells software what those numbers &lt;em&gt;mean&lt;/em&gt;: degrees of latitude and longitude, metres in a UTM zone, metres in Web Mercator, and so on.&lt;/p&gt;

&lt;p&gt;A shapefile stores that information in its &lt;code&gt;.prj&lt;/code&gt; file. If the &lt;code&gt;.prj&lt;/code&gt; is missing, or wrong, your GIS has to guess, and a wrong guess moves your data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diagnose it by distance
&lt;/h2&gt;

&lt;p&gt;Measure roughly how far your data is from where it should be, then check this table:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;How far off&lt;/th&gt;
&lt;th&gt;Most likely cause&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A few metres to a few hundred metres&lt;/td&gt;
&lt;td&gt;Wrong datum (e.g. an old local datum treated as WGS 84)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Roughly 500–700 km east or west&lt;/td&gt;
&lt;td&gt;Wrong UTM zone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;About 10,000 km north or south&lt;/td&gt;
&lt;td&gt;Wrong hemisphere (UTM north vs south)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A different continent, or the Arctic&lt;/td&gt;
&lt;td&gt;Latitude and longitude swapped&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A tiny dot near 0°, 0° in the Atlantic&lt;/td&gt;
&lt;td&gt;Missing coordinates, or degrees read as metres&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nowhere at all / "zoom to layer" goes somewhere strange&lt;/td&gt;
&lt;td&gt;Metres read as degrees&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Latitude and longitude swapped
&lt;/h3&gt;

&lt;p&gt;Delhi is at about 28.6° N, 77.2° E. Swap the two and you get 77.2° N, 28.6° E, which is up near Svalbard in the Arctic. If your points land on the wrong continent, check the axis order first. This happens a lot with CSV files and some APIs that expect &lt;code&gt;lon, lat&lt;/code&gt; instead of &lt;code&gt;lat, lon&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Degrees read as metres (or the other way round)
&lt;/h3&gt;

&lt;p&gt;If data in degrees is labelled as a projected CRS, a value like &lt;code&gt;77.2&lt;/code&gt; is treated as 77.2 &lt;em&gt;metres&lt;/em&gt;. Your whole dataset collapses into a tiny cluster near the origin of the projection.&lt;/p&gt;

&lt;p&gt;If data in metres is labelled as WGS 84, a value like &lt;code&gt;712345&lt;/code&gt; is far outside the valid range for degrees, so the layer seems to disappear.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrong UTM zone or hemisphere
&lt;/h3&gt;

&lt;p&gt;UTM splits the world into 6°-wide zones. Using the neighbouring zone shifts everything sideways by one zone width, which is several hundred kilometres. Using the southern hemisphere instead of the northern adds a 10,000 km false northing, so data jumps by roughly a quarter of the planet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrong datum
&lt;/h3&gt;

&lt;p&gt;This is the sneaky one. Everything looks &lt;em&gt;almost&lt;/em&gt; right, but buildings are a bit off their footprints or roads are offset from the satellite image. Older local datums can differ from WGS 84 by tens to hundreds of metres.&lt;/p&gt;

&lt;h2&gt;
  
  
  Assign vs reproject: don't mix them up
&lt;/h2&gt;

&lt;p&gt;This is where most fixes go wrong.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Assign (define) a CRS&lt;/strong&gt; when the &lt;code&gt;.prj&lt;/code&gt; is missing or wrong. It changes the &lt;em&gt;label&lt;/em&gt;, not the numbers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reproject (transform)&lt;/strong&gt; when the label is already correct and you want the data in a different CRS. It changes the &lt;em&gt;numbers&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your data is in the wrong place, you almost always need to &lt;strong&gt;assign&lt;/strong&gt; the correct CRS. Reprojecting data that has the wrong label just moves the mistake somewhere else.&lt;/p&gt;

&lt;p&gt;In QGIS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Assign: Layer Properties → Source → &lt;em&gt;Assigned Coordinate Reference System&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Reproject: right-click the layer → Export → Save Features As → choose a new CRS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With GDAL's &lt;code&gt;ogr2ogr&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Assign a CRS (fix the label only)&lt;/span&gt;
ogr2ogr &lt;span class="nt"&gt;-a_srs&lt;/span&gt; EPSG:32643 fixed.shp input.shp

&lt;span class="c"&gt;# Reproject from UTM 43N to WGS 84 (change the coordinates)&lt;/span&gt;
ogr2ogr &lt;span class="nt"&gt;-s_srs&lt;/span&gt; EPSG:32643 &lt;span class="nt"&gt;-t_srs&lt;/span&gt; EPSG:4326 output.shp input.shp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Quick checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Is there a &lt;code&gt;.prj&lt;/code&gt; file next to the &lt;code&gt;.shp&lt;/code&gt;? If not, find out the real CRS from whoever made the data.&lt;/li&gt;
&lt;li&gt;Look at a few raw coordinate values. Numbers under 180 are probably degrees; six- or seven-digit numbers are probably metres.&lt;/li&gt;
&lt;li&gt;Measure how far off the data is and use the table above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assign&lt;/strong&gt; the correct CRS, then reproject only if you need a different output CRS.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;I wrote a longer version of this, with more examples, on my site: &lt;a href="https://sarvdevtool.in/guides/shapefile-wrong-location" rel="noopener noreferrer"&gt;Why your shapefile shows up in the wrong place&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you just need GeoJSON, I also built a free &lt;a href="https://sarvdevtool.in/gis-tools/shapefile-to-geojson" rel="noopener noreferrer"&gt;Shapefile to GeoJSON converter&lt;/a&gt; that reads the &lt;code&gt;.prj&lt;/code&gt; and reprojects to WGS 84 automatically. It runs in your browser.&lt;/p&gt;

&lt;p&gt;What's the strangest place your data has ever ended up? 🌍&lt;/p&gt;

</description>
      <category>gis</category>
      <category>geojson</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
