Jody asked me to move this question to the user's list. My apologies. He also
asked about the version. I'm using a slightly modified 13-SNAPSHOT.
All,
I'm trying to use Geotools to query a Mapserver instance.
Map params = new HashMap();
params.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", capUrl);
params.put("WFSDataStoreFactory:WFS_STRATEGY", "mapserver");
String typeName = "ms_cities";
WFSDataStoreFactory fact = new WFSDataStoreFactory();
WFSDataStore dataStore = fact.createDataStore(params);
SimpleFeatureSource sfs = dataStore.getFeatureSource(typeName);
FilterFactory2 ff =
CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
Query query = new Query();
query.setTypeName(typeName);
GeometryDescriptor geometryDesc =
dataStore.getSchema(typeName).getGeometryDescriptor();
CoordinateReferenceSystem crs = geometryDesc.getCoordinateReferenceSystem();
ReferencedEnvelope env = new ReferencedEnvelope(-59, -58, -35, -34, crs);
Filter filter = ff.bbox(ff.property("msGeometry"), env);
query.setFilter(filter);
The code above (with some slight modifications to the wfs-ng module) produces a
BBOX filter in the following format:
<gml:coord><gml:X>-59.0</gml:X><gml:Y>-35.0</gml:Y></gml:coord><gml:coord><
gml:X>-58.0</gml:X><gml:Y>-34.0</gml:Y></gml:coord>
Unfortunately, the Mapserver instance wants the coordinates in the following
format:
<gml:coordinates cs="," decimal="." ts=" ">-59,-35 -58,-34</gml:coordinates>
Is there any way to accomplish this? I've tried setting the geometry factory
on the dataStore object and the query object (through the Hints), which
unfortunately, didn't work.
Does anyone know how to change this behavior?
Thanks,
Mike
________________________________
This e-mail and any files transmitted with it may be proprietary and are
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely
those of the author and do not necessarily represent those of Exelis Inc. The
recipient should check this e-mail and any attachments for the presence of
viruses. Exelis Inc. accepts no liability for any damage caused by any virus
transmitted by this e-mail.
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users