Not sure what you mean by “version of the protocol”.

From: Jody Garnett [mailto:jody.garn...@gmail.com]
Sent: Friday, October 31, 2014 12:34 PM
To: Farwell, Michael D - Exelis
Cc: geotools-gt2-users@lists.sourceforge.net
Subject: Re: [Geotools-gt2-users] WFS 1.0.0 GetFeature BBOX filter

Both are valid - because GML is insane. Ideally we would like MapServer to 
relax - we could introduce a strategy object for different dialects of WFS to 
record implementation glitches (such as which flavour of GML they prefer).

I did not see from your example what version of the protocol you were trying to 
use?






Jody Garnett

On Fri, Oct 31, 2014 at 5:50 AM, Farwell, Michael D - Exelis 
<michael.farw...@exelisinc.com<mailto:michael.farw...@exelisinc.com>> wrote:
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
GeoTools-GT2-Users@lists.sourceforge.net<mailto:GeoTools-GT2-Users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to