Class ProjectionConverter
This class represents a projection that you wish to apply to a FeatureSource.
public class ProjectionConverter
- Inheritance
-
ProjectionConverter
- Derived
- Inherited Members
Remarks
This class is abstract and designed to be inherited to create your own projection. The derived projection classes are typically used on a FeatureSource or Layer. It is used to project coordinates from one projection to another and back again. It is important to note that you need to implement the projection both ways.
Constructors
ProjectionConverter()
This is the default constructor for this class.
public ProjectionConverter()
Remarks
This conctructor pass nothing. After this cconstructor , you should set the InternalProjectionParametersString property and ExternalProjectionParametersString property before open to use.
ProjectionConverter(int, int)
public ProjectionConverter(int internalSrid, int externalSrid)
Parameters
ProjectionConverter(int, string)
public ProjectionConverter(int internalSridString, string externalProjString)
Parameters
ProjectionConverter(string, int)
public ProjectionConverter(string internalProjString, int externalSrid)
Parameters
ProjectionConverter(string, string)
public ProjectionConverter(string internalProjString, string externalProjString)
Parameters
ProjectionConverter(Projection, Projection)
This is a constructor for the class.
public ProjectionConverter(Projection internalProjection, Projection externalProjection)
Parameters
internalProjectionProjectionThis parameter is the projection parameters describing the data.
externalProjectionProjectionThis parameter is the projection parameters describing the projection you want to go to.
Remarks
This constructor allows you to pass in Proj4 text parameters for the to and from projection. The parameters typically look like "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" You should use this constructor when you know the parameters. If you know the SRID directly you can use the other constructor that takes the SRID.
Properties
CanConvertRasterToExternalProjection
public bool CanConvertRasterToExternalProjection { get; protected set; }
Property Value
DecimalDegreeBoundary
public RectangleShape DecimalDegreeBoundary { get; set; }
Property Value
ExternalProjection
Gets or sets the Proj4 text parameter for the to projection. This parameter typically look like "+proj=utm +zone=33 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs".
public Projection ExternalProjection { get; set; }
Property Value
InternalProjection
Gets or sets the Proj4 text parameter for the from projection. This parameter typically look like "+Proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs".
public Projection InternalProjection { get; set; }
Property Value
InternalProjectionUnit
public virtual GeographyUnit InternalProjectionUnit { get; }
Property Value
IsOpen
This property gets the state of the projection (whether it is opened or closed).
public bool IsOpen { get; protected set; }
Property Value
Remarks
This method will reflect whether the projection is opened or closed. It is set in the concrete methods Open and Close, so if you inherit from this class and override OpenCore or CloseCore, you will not need to be concerned with setting this property.
Methods
Close()
This method closes the projection and gets it ready for serialization if necessary.
public void Close()
Remarks
This method closes the projection and gets it ready for serialization if
necessary.
As this is a concrete public method that wraps a Core method, we reserve the right
to add events and other logic to pre- or post-process data returned by the Core version
of the method. In this way, we leave our framework open on our end, but also allow you
the developer to extend our logic to suit your needs. If you have questions about this,
please contact our support team as we would be happy to work with you on extending our
framework.
CloseCore()
This method closes the projection and gets it ready for serialization if necessary.
protected virtual void CloseCore()
Remarks
As this is the core version of the Close method, it is intended to be overridden in an inherited version of the class. When overriding, you will be responsible freeing any state you have maintained and getting the class ready for serialization if necessary. Note that the object may be opened again, so you want to make sure you can open and close the object multiple times without any ill effects.
Convert(int, int, IEnumerable<Feature>)
public static IEnumerable<Feature> Convert(int fromSrid, int toSrid, IEnumerable<Feature> features)
Parameters
fromSridinttoSridintfeaturesIEnumerable<Feature>
Returns
Convert(int, int, IEnumerable<Vertex>)
public static IEnumerable<Vertex> Convert(int fromSrid, int toSrid, IEnumerable<Vertex> vertices)
Parameters
fromSridinttoSridintverticesIEnumerable<Vertex>
Returns
Convert(int, int, double, double)
public static Vertex Convert(int fromSrid, int toSrid, double x, double y)
Parameters
Returns
Convert(int, int, Feature)
public static Feature Convert(int fromSrid, int toSrid, Feature feature)
Parameters
Returns
Convert(int, int, PointShape)
public static PointShape Convert(int fromSrid, int toSrid, PointShape sourcePoint)
Parameters
fromSridinttoSridintsourcePointPointShape
Returns
Convert(int, int, RectangleShape)
public static RectangleShape Convert(int fromSrid, int toSrid, RectangleShape rectangleShape)
Parameters
fromSridinttoSridintrectangleShapeRectangleShape
Returns
Convert(int, string, IEnumerable<Feature>)
public static IEnumerable<Feature> Convert(int fromSrid, string toProjString, IEnumerable<Feature> features)
Parameters
fromSridinttoProjStringstringfeaturesIEnumerable<Feature>
Returns
Convert(int, string, IEnumerable<Vertex>)
public static IEnumerable<Vertex> Convert(int fromSrid, string toProjString, IEnumerable<Vertex> vertices)
Parameters
fromSridinttoProjStringstringverticesIEnumerable<Vertex>
Returns
Convert(int, string, double, double)
public static Vertex Convert(int fromSrid, string toProjString, double x, double y)
Parameters
Returns
Convert(int, string, Feature)
public static Feature Convert(int fromSrid, string toProjString, Feature feature)
Parameters
Returns
Convert(int, string, PointShape)
public static PointShape Convert(int fromSrid, string toProjString, PointShape sourcePoint)
Parameters
fromSridinttoProjStringstringsourcePointPointShape
Returns
Convert(int, string, RectangleShape)
public static RectangleShape Convert(int fromSrid, string toProjString, RectangleShape rectangleShape)
Parameters
fromSridinttoProjStringstringrectangleShapeRectangleShape
Returns
Convert(string, int, IEnumerable<Feature>)
public static IEnumerable<Feature> Convert(string fromProjString, int toSrid, IEnumerable<Feature> features)
Parameters
fromProjStringstringtoSridintfeaturesIEnumerable<Feature>
Returns
Convert(string, int, IEnumerable<Vertex>)
public static IEnumerable<Vertex> Convert(string fromProjString, int toSrid, IEnumerable<Vertex> vertices)
Parameters
fromProjStringstringtoSridintverticesIEnumerable<Vertex>
Returns
Convert(string, int, double, double)
public static Vertex Convert(string fromProjString, int toSrid, double x, double y)
Parameters
Returns
Convert(string, int, Feature)
public static Feature Convert(string fromProjString, int toSrid, Feature feature)
Parameters
Returns
Convert(string, int, PointShape)
public static PointShape Convert(string fromProjString, int toSrid, PointShape sourcePoint)
Parameters
fromProjStringstringtoSridintsourcePointPointShape
Returns
Convert(string, int, RectangleShape)
public static RectangleShape Convert(string fromProjString, int toSrid, RectangleShape rectangleShape)
Parameters
fromProjStringstringtoSridintrectangleShapeRectangleShape
Returns
Convert(string, string, IEnumerable<Feature>)
public static IEnumerable<Feature> Convert(string fromProjString, string toProjString, IEnumerable<Feature> features)
Parameters
fromProjStringstringtoProjStringstringfeaturesIEnumerable<Feature>
Returns
Convert(string, string, IEnumerable<Vertex>)
public static IEnumerable<Vertex> Convert(string fromProjString, string toProjString, IEnumerable<Vertex> vertices)
Parameters
fromProjStringstringtoProjStringstringverticesIEnumerable<Vertex>
Returns
Convert(string, string, double, double)
public static Vertex Convert(string fromProjString, string toProjString, double x, double y)
Parameters
Returns
Convert(string, string, Feature)
public static Feature Convert(string fromProjString, string toProjString, Feature feature)
Parameters
Returns
Convert(string, string, PointShape)
public static PointShape Convert(string fromProjString, string toProjString, PointShape sourcePoint)
Parameters
fromProjStringstringtoProjStringstringsourcePointPointShape
Returns
Convert(string, string, RectangleShape)
public static RectangleShape Convert(string fromProjString, string toProjString, RectangleShape rectangleShape)
Parameters
fromProjStringstringtoProjStringstringrectangleShapeRectangleShape
Returns
Convert(Projection, Projection, IEnumerable<Feature>)
public static IEnumerable<Feature> Convert(Projection fromProjection, Projection toProjection, IEnumerable<Feature> features)
Parameters
fromProjectionProjectiontoProjectionProjectionfeaturesIEnumerable<Feature>
Returns
Convert(Projection, Projection, IEnumerable<Vertex>)
public static IEnumerable<Vertex> Convert(Projection fromProjection, Projection toProjection, IEnumerable<Vertex> vertices)
Parameters
fromProjectionProjectiontoProjectionProjectionverticesIEnumerable<Vertex>
Returns
Convert(Projection, Projection, double, double)
public static Vertex Convert(Projection fromProjection, Projection toProjection, double x, double y)
Parameters
fromProjectionProjectiontoProjectionProjectionxdoubleydouble
Returns
Convert(Projection, Projection, Feature)
public static Feature Convert(Projection fromProjection, Projection toProjection, Feature feature)
Parameters
fromProjectionProjectiontoProjectionProjectionfeatureFeature
Returns
Convert(Projection, Projection, PointShape)
public static PointShape Convert(Projection fromProjection, Projection toProjection, PointShape sourcePoint)
Parameters
fromProjectionProjectiontoProjectionProjectionsourcePointPointShape
Returns
Convert(Projection, Projection, RectangleShape)
public static RectangleShape Convert(Projection fromProjection, Projection toProjection, RectangleShape rectangleShape)
Parameters
fromProjectionProjectiontoProjectionProjectionrectangleShapeRectangleShape
Returns
ConvertToExternalProjection(IEnumerable<Feature>)
public Collection<Feature> ConvertToExternalProjection(IEnumerable<Feature> features)
Parameters
featuresIEnumerable<Feature>
Returns
ConvertToExternalProjection(IEnumerable<Vertex>)
This method returns projected vertices based on the coordinates passed in.
public Collection<Vertex> ConvertToExternalProjection(IEnumerable<Vertex> vertices)
Parameters
verticesIEnumerable<Vertex>This parameter is the vertices that will be projected.
Returns
- Collection<Vertex>
This method returns projected vertices based on the coordinates passed in.
Remarks
This method returns a projected vertex based on the coordinates passed in. You will need to override this method for the Projection class. Typically, you can call the projection utility library that has interfaces for dozens of different types of projections.
ConvertToExternalProjection(double, double)
This method returns a projected vertex based on the coordinates passed in.
public Vertex ConvertToExternalProjection(double x, double y)
Parameters
xdoubleThis parameter is the X decimalDegreesValue of the point that will be projected.
ydoubleThis parameter is the Y decimalDegreesValue of the point that will be projected.
Returns
- Vertex
This method returns a projected vertex based on the coordinates passed in.
Remarks
This method returns a projected vertex based on the coordinates passed in.
As this is a concrete public method that wraps a Core method, we reserve the right
to add events and other logic to pre- or post-process data returned by the Core version
of the method. In this way, we leave our framework open on our end, but also allow you
the developer to extend our logic to suit your needs. If you have questions about this,
please contact our support team as we would be happy to work with you on extending our
framework.
ConvertToExternalProjection(BaseShape)
This method returns a projected BaseShape based on the baseShape passed in.
public BaseShape ConvertToExternalProjection(BaseShape baseShape)
Parameters
baseShapeBaseShapeThis parameter is the baseShape (in decimalDegreesValue) to be projected.
Returns
- BaseShape
This method returns a projected baseShape for the passed-in BaseShape.
Remarks
This method returns a projected baseShape based on the BaseShape passed in.
As this is a concrete public method that wraps a Core method, we reserve the right
to add events and other logic to pre- or post-process data returned by the Core version
of the method. In this way, we leave our framework open on our end, but also allow you
the developer to extend our logic to suit your needs. If you have questions about this,
please contact our support team as we would be happy to work with you on extending our
framework.
ConvertToExternalProjection(Feature)
This method returns a projected Feature based on the Feature passed in.
public Feature ConvertToExternalProjection(Feature feature)
Parameters
featureFeatureThis parameter is the Feature that contains a BaseShape in decimalDegreesValue to be projected.
Returns
- Feature
This method returns a projected Feature for the passed-in Feature.
Remarks
This method returns a projected Feature based on the Feature passed in.
As this is a concrete public method that wraps a Core method, we reserve the right
to add events and other logic to pre- or post-process data returned by the Core version
of the method. In this way, we leave our framework open on our end, but also allow you
the developer to extend our logic to suit your needs. If you have questions about this,
please contact our support team as we would be happy to work with you on extending our
framework.
ConvertToExternalProjection(GeoImage, RectangleShape)
public RasterProjectionResult ConvertToExternalProjection(GeoImage image, RectangleShape imageExtent)
Parameters
imageGeoImageimageExtentRectangleShape
Returns
ConvertToExternalProjection(GeoImage, RectangleShape, RectangleShape)
public RasterProjectionResult ConvertToExternalProjection(GeoImage image, RectangleShape imageExtent, RectangleShape targetExtent)
Parameters
imageGeoImageimageExtentRectangleShapetargetExtentRectangleShape
Returns
ConvertToExternalProjection(GeoImage, RectangleShape, RectangleShape, int, int)
public RasterProjectionResult ConvertToExternalProjection(GeoImage image, RectangleShape imageExtent, RectangleShape targetExtent, int width, int height)
Parameters
imageGeoImageimageExtentRectangleShapetargetExtentRectangleShapewidthintheightint
Returns
ConvertToExternalProjection(RectangleShape)
This method returns a projected rectangle based on the rectangle passed in.
public RectangleShape ConvertToExternalProjection(RectangleShape rectangleShape)
Parameters
rectangleShapeRectangleShapeThis parameter represents the rectangle you want to project.
Returns
- RectangleShape
This method returns a projected rectangle based on the rectangle passed in.
Remarks
This method returns a projected rectangle based on the rectangle passed in.
ConvertToExternalProjectionCore(IEnumerable<Vertex>)
This method returns projected vertices based on the coordinates passed in.
protected virtual Collection<Vertex> ConvertToExternalProjectionCore(IEnumerable<Vertex> verticies)
Parameters
verticiesIEnumerable<Vertex>
Returns
- Collection<Vertex>
This method returns projected vertices based on the coordinates passed in.
Remarks
This method returns a projected vertex based on the coordinates passed in. You will need to override this method for the Projection class. Typically, you can call the projection utility library that has interfaces for dozens of different types of projections.
ConvertToExternalProjectionCore(GeoImage, RectangleShape, RectangleShape, int, int)
protected virtual RasterProjectionResult ConvertToExternalProjectionCore(GeoImage image, RectangleShape imageExtent, RectangleShape targetExtent, int width, int height)
Parameters
imageGeoImageimageExtentRectangleShapetargetExtentRectangleShapewidthintheightint
Returns
ConvertToInternalProjection(IEnumerable<Vertex>)
This method returns de-projected vertices based on the coordinates passed in.
public Collection<Vertex> ConvertToInternalProjection(IEnumerable<Vertex> vertices)
Parameters
verticesIEnumerable<Vertex>This parameter is the vertices that will be de-projected.
Returns
- Collection<Vertex>
This method returns de-projected vertices based on the coordinates passed in.
Remarks
This method returns a de-projected vertex based on the coordinates passed in. The de-projection is important because, inside of the FeatureSource, you will in many cases go to and from various projections.
ConvertToInternalProjection(double, double)
This method returns a de-projected vertex based on the coordinates passed in.
public Vertex ConvertToInternalProjection(double x, double y)
Parameters
xdoubleThis parameter is the X decimalDegreesValue of the point that will be de-projected.
ydoubleThis parameter is the Y decimalDegreesValue of the point that will be de-projected.
Returns
- Vertex
This method returns a de-projected vertex based on the coordinates passed in.
Remarks
This method returns a de-projected vertex based on the coordinates passed
in.
As this is a concrete public method that wraps a Core method, we reserve the right
to add events and other logic to pre- or post-process data returned by the Core version
of the method. In this way, we leave our framework open on our end, but also allow you
the developer to extend our logic to suit your needs. If you have questions about this,
please contact our support team as we would be happy to work with you on extending our
framework.
ConvertToInternalProjection(BaseShape)
This method returns a de-projected BaseShape based on the BaseShape passed in.
public BaseShape ConvertToInternalProjection(BaseShape baseShape)
Parameters
baseShapeBaseShapeThis parameter is the baseShape (in decimalDegreesValue) to be de-projected.
Returns
- BaseShape
This method returns a de-projected BaseShape for the passed in BaseShape.
Remarks
This method returns a de-projected BaseShape based on the BaseShape passed
in.
As this is a concrete public method that wraps a Core method, we reserve the right
to add events and other logic to pre- or post-process data returned by the Core version
of the method. In this way, we leave our framework open on our end, but also allow you
the developer to extend our logic to suit your needs. If you have questions about this,
please contact our support team as we would be happy to work with you on extending our
framework.
ConvertToInternalProjection(Feature)
This method returns a de-projected Feature based on the Feature passed in.
public Feature ConvertToInternalProjection(Feature feature)
Parameters
featureFeatureThis parameter is the Feature that contains a BaseShape in decimalDegreesValue to be de-projected.
Returns
- Feature
This method returns a de-projected Feature for the passed-in Feature.
Remarks
This method returns a de-projected Feature based on the Feature passed in.
As this is a concrete public method that wraps a Core method, we reserve the right
to add events and other logic to pre- or post-process data returned by the Core version
of the method. In this way, we leave our framework open on our end, but also allow you
the developer to extend our logic to suit your needs. If you have questions about this,
please contact our support team as we would be happy to work with you on extending our
framework.
ConvertToInternalProjection(RectangleShape)
This method returns a de-projected rectangle based on the rectangle passed in.
public RectangleShape ConvertToInternalProjection(RectangleShape rectangleShape)
Parameters
rectangleShapeRectangleShapeThis parameter represents the rectangle you want to de-project.
Returns
- RectangleShape
This method returns a de-projected rectangle based on the rectangle passed in.
Remarks
This method returns a de-projected rectangle based on the rectangle passed in.
ConvertToInternalProjectionCore(IEnumerable<Vertex>)
This method returns de-projected vertices based on the coordinates passed in.
protected virtual Collection<Vertex> ConvertToInternalProjectionCore(IEnumerable<Vertex> verticies)
Parameters
verticiesIEnumerable<Vertex>
Returns
- Collection<Vertex>
This method returns de-projected vertices based on the coordinates passed in.
Remarks
This method returns a de-projected vertex based on the coordinates passed in. You will need to override this method for the Projection class. Typically, you can call the projection utility library that has interfaces for dozens of different types of projections. The de-projection is important because, inside of the FeatureSource, you will in many cases go to and from various projections.
Open()
This method opens the projection and gets it ready to use.
public void Open()
Remarks
This method opens the projection and gets it ready to use.
As this is a concrete public method that wraps a Core method, we reserve the right
to add events and other logic to pre- or post-process data returned by the Core version
of the method. In this way, we leave our framework open on our end, but also allow you
the developer to extend our logic to suit your needs. If you have questions about this,
please contact our support team as we would be happy to work with you on extending our
framework.
OpenCore()
This method opens the projection and gets it ready to use.
protected virtual void OpenCore()
Remarks
As this is the core version of the Open method, it is intended to be overridden in an inherited version of the class. When overriding, you will be responsible for getting the projection classes' state ready for doing projections.