SharpMap – Geospatial Application Framework for the CLR – Documentation

  1. Home
  2. map design tutorials
  3. SharpMap – Geospatial Application Framework for the CLR – Documentation

SharpMap can project between various projections on-the-fly. All you need to know is the spatial reference system of your input-data to enable you to reproject your maps. SharpMap gives you the full power to specify all the parameters in a projection. The following method demonstrates how to setup a UTM projection: If you have a well-known text-representation, you can also create a projection from this. A WKT for an UTM projection might look like this: SharpMap comes with WKT parsers for parsing a WKT to a coordinate system (note: the current v0.9RC1 has a few bug in its WKT parser, but if you get problems parsing the WKT, use the current source from the repository, where these issues have been resolved) If your data is based on shapefile data and they have a .prj file defining the coordinatesystem, you can simply retrieve the CS from the shapefile instead. SharpMap automatically reads and parses the PRJ file. The next step is to create a transformation between two coordinate systems. SharpMap v0.9RC1 only supports transforming between a geographic coordinate system and one of the following projections (this has changed after the RC1 release): Unfortunately datum-shifts and transformations between two projections are also post RC1, so to utilize this feature you will need the newest source and compile. The following shows how to create a transformation and apply it to a vectorlayer (only vector- and label-layers supports on-the-fly transformations): CoordinateTransformationFactory(), ICoordinateTransformation transform = ctFac.CreateFromCoordinateSystems(source, target), Source.

whatsapp button