Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a dxf file and use this tool to convert it to shapefile.

Then I apply some affine transformations and get a shapefile that does not fit the shapefiles downloaded from osm (EPSG:4326).

I know that I have to reproject the shapefile using ogr2ogr (am I right?), but as I began without no clue of what was the original CRS, how can achieve the desired result of all districts in green of the picture on the right to fit as the magenta ones on the left one?

Thank you in advance !

Cordoba province on CAD (dxf) at left, and shapefile after affine at right

share|improve this question
Another solution would be distort visually the green line layer, as the QGIS plugin Affine is not of much help here in this case... but cannot find such a tool in any open source GIS. – Martin0x777 Feb 28 '13 at 12:47
Can you check here? Maybe you can get an idea of the projection of your dxf file. – Gus Velasco Mar 10 '13 at 22:35
Thanks, it will be a nice aid! – Martin0x777 Mar 22 '13 at 22:43
When i know data creator, i ask him to get data in specific projection. It can change false east and false north for path origin of data. Next use ogr2ogr. see…. QGIS can help you with affine plugin for fix deformations (just for patch, this not best practice) – GeoStoneMarten Nov 26 '15 at 22:25

If you want the shape fit to the OSM data, you have to know the projection of your dxf file.

To get an idea, could you post the extent of the coordinates and a sample point, e.g. from the rectangular border lines edges at the bottom of the map, both in the dxf file and in OSM lat/lon?

The OSM data is unprojected (that is, not in metres, but in degrees). That's why the data would not fit automatically or with affine transformations.

share|improve this answer
Thanks, but then why on osm extracts is specified EPSG:4326? – Martin0x777 Mar 22 '13 at 22:43
Because OSM stores all geographic data in lat/long degrees. It is no problem to create a shapefile with that CRS, and reproject it to another CRS using metres as units. I use Qunatum GIS for such operations. – AndreJ Mar 23 '13 at 6:12
Thank you Andre. The extent of coordinates of the picture is aproximately -61.50, -29.40 to -65.90, -35.20. I don't know how to determine a coordinate based on the linestring field of a database... The little square of the upper center is at -31°25′ -64°11′. – Martin0x777 Mar 25 '13 at 21:30

Project your OSM data to a cartesian coordinate system (e.g., a UTM), which enables you to apply an affine transformation on your data.

It's not mandatory that you know the reference system of the vector file. You will take the projected OSM data as reference anyways.

Now follow the steps I wrote in the answer to this post which describe the process of applying an affine transformation, from picking control points to entering parameters to the QGIS plugin Affine transformations.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.