[mapguide-users] Re: Fetching features within rectangle; layer SRS differs from map SRS

Patrik Johansson mapguide at morkl.se
Thu Dec 8 10:29:41 EST 2011


Thanks - seems like it was hidden a bit deeper than i looked!

However, I have not managed to make it work -
layer.GetClassDefinition() throws a MgNullReferenceException with a
reference to an empty System.Collections.ListDictionaryInternal for
all my layers.

Any idea why this might be? Is there anything else I have to do before
fetching the class definition, or another way to fetch it?

Best regards,
Patrik Johansson

On Thu, Dec 8, 2011 at 2:41 PM, Jackie Ng <jumpinjackie at gmail.com> wrote:
> To get the layer's coordinate system, get the class definition of the layer
> and then get the spatial context association of the geometry property in
> this class definition.
>
> Then query the spatial contexts of the feature source your layer uses, and
> find the spatial context whose name matches the association.
>
> This spatial context's coordinate system WKT is the coordinate system the
> layer is using. With this WKT and the map's WKT, you can create the
> equivalent MgCoordinateSystem objects and the MgTransform to transform
> coordinates
>
> - Jackie
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Fetching-features-within-rectangle-layer-SRS-differs-from-map-SRS-tp7074044p7074276.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users


More information about the mapguide-users mailing list