[mapguide-users] Create feature source from FeatureReader

Kenneth, GEOGRAF A/S ks at geograf.dk
Sun Jan 6 12:44:08 EST 2008


That is exactly what a layer filter does.
You have to construct it as an FDO filter.

First thing you need is an WKT representation of your filter object.
A polygon looks like this in WKT: "POLYGON((x1 y1, x2 y2, x3 y3, x1 y1))"
If the object you are using as a spatial filter is retrieved from an FDO 
datasource, you can retrive the WKT directly by calling a method on the 
object.

Next step is to create a copy of a layer, modify the filter and save it 
in the session repo.
Then you insert your newly created layer into the runtime map.
Finally, refresh the client map.

The filter string should look like this:
"...geom_column... intersects GEOMFROMTEXT('...wkt...')"
replace ..geom_column... with the name of the column that contains 
geometry, and ...wkt... with the WKT of the item you are filtering with.

There are other spatial operators avalible, like "inside".

It is a lot of work to acomplish something that is basically simple.
The end result should be pretty generic.
There is an explanation of all the steps in the Dev guide (PDF), and 
sample code in the "buffer" sample code installed with MapGuide.

If you pull it off, and have the legal authority to share the code, you 
can add it here:
http://trac.osgeo.org/mapguide/wiki/CodeSamples

Regards, Kenneth, GEOGRAF A/S



mates skrev:
> OK, i tell you what i need to do.
>
> I retrieve features from a spatial filter and then i need  to show only
> these features.The others can be deleted or hidden.
>
> I think that in this case the LayerDefinition filter can't help me.
>
> Thanky for your patience with me :-)
>   


More information about the mapguide-users mailing list