3

Is there any C# library which can take a shapefile as an input with projection information defined (e.g, EPSG 3011) and return a new shapefile with user specified projection (e.g, EPSG 4326) ?

4

GDAL/OGR has C# bindings. You might want to check it out. Alternatively, you might also want to check dotspatial. The dotspatial page has sample code on reprojecting a shape file.


You can do this in ogr ( It's provided in the FWTools package ). No need to code in C#.

ogr2ogr -s_srs EPSG:3011 -t_srs EPSG:4326 outfile.shp infile.shp

Thanks @iant for pointing it out.

  • OK! is there any piece of code you may know, which could take shapefile as an input ? – user1899 Feb 8 '12 at 13:40
  • 1
    ogr2ogr will do this – Ian Turton Feb 8 '12 at 14:19
  • @user1899 Why does it have to be a C# library btw? – R.K. Feb 8 '12 at 15:02
  • As i understand it is command line tool, But I need to change shapefile projection within my web C# application code. How I use ogr2ogr in my C# code? – user1899 Feb 8 '12 at 17:00
  • 1
    @user1899 Use the C# bindings for that. – R.K. Feb 9 '12 at 2:52

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.