Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public ISpatialReference getSpatialReference_byCode(int srid)
  2. {
  3. ISpatialReference spatialReference;
  4. ISpatialReferenceFactory sr_factory = new SpatialReferenceEnvironmentClass();
  5. try
  6. {
  7. spatialReference = sr_factory.CreateGeographicCoordinateSystem(srid);
  8. }
  9. catch
  10. {
  11. try
  12. {
  13. spatialReference = sr_factory.CreateProjectedCoordinateSystem(srid);
  14. }
  15. catch
  16. {
  17. throw new NotImplementedException("This is an unkown Spatial Reference");
  18. }
  19. }
  20.  
  21. return spatialReference;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement