2


I want to convert files from within my application. I've tried a lot, but I can't find a solution. I have a DXF file with which I know the projection system (EPSG:4326). And I want to transform it to a shapefile with projection.

Here are a few of my experiments;

fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" --_SOURCE_CSYS "EPSG:4326" --_DEST_CSYS "EPSG:3857"
or
fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" --_SOURCE_CSYS EPSG:4326 --_DEST_CSYS EPSG:3857
or
fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" --ACAD_COORDINATE_SYSTEM "EPSG:4326" --_DEST_CSYS "EPSG:3857"
or
fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" --ACAD_COORDINATE_SYSTEM EPSG:4326 --ESRISHAPE_COORDINATE_SYSTEM EPSG:3857
or
fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" COORDSYS, "EPSG:4326" ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" COORDSYS, "EPSG:3857"
or
fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" COORDSYS, EPSG:4326 ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" COORDSYS, EPSG:3857
or
fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" --COORDSYS "EPSG:4326" ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" COORDSYS "EPSG:3857"
or
fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" --COORDSYS EPSG:4326 ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" --COORDSYS EPSG:3857

This code will use in C# project.

When I use FME Desktop Translator then it output files has *.prj. (Total 4 files)

When i use FME Console App then it output files hasn't *.prj (Total 3 files - *.dbf, *.shp, *.shx)

How can i set projection system on converting process?

1

You are aiming to convert between a DXF in WGS84 lat/lon to a shapefile in spherical mercator E/N. When building the gentrans command, try using the coordinate system name rather than the EPSG code. This should work:

fme gentrans ACAD "C:\Users\User\Desktop\1360\File.dxf" COORDSYS,LL84 ESRISHAPE "C:\Users\User\Desktop\1360\SHP\" COORDSYS,SPHERICAL_MERCATOR

Notes: No spaces in the COORDSYS argument. Tested in FME v2017.0.1.1 win32.

There is further guidance on the gentrans function on the FME Knowledge Centre here.

1
  • 1
    Hi JimT, I tried ways of this site. I solved problem but cant close ticket. Solution: Create batch file using FME for same spatial files. I modified TCL files and send FME as argument. Thank you for your interest – Mehmet Ali DUMLU Oct 3 '19 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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