Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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) ?

share|improve this question

1 Answer 1

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.

share|improve this answer
    
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 –  iant 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

 
discard

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.