Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a set of x-coord and y-coord coordinates in separate columns in a PostGIS table. I also have a separate geometry column, named the_geom, of type Point. I've written an Intersects filter to filter points within a polygon. However, the WFS request that uses the filter returns nothing, even though I'm sure there's data within the selected polygon.

This brings me to the question: Should I use the x and y coordinates in an interiorPoint filter instead of the Intersects filter? I've never used an interiorPoint filter before. I've also gone through GeoServer manual for more details on the filter, but there appears to be none. So, an example on how to use the interiorPoint filter will be appreciated.

UPDATE: I figured this out:

  1. include srsName: "EPSG:4326" in the WFS protocol definition.
  2. transform the selection (polygon geometry) to the projection used by the WFS layer, i.e., event.feature.geometry.transform(map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326")).

These two actions sorted out my issue.

share|improve this question
add comment

1 Answer

I have a simillar question. I would appreciate if you answer this. I have a table world_country in postgis db, having two columns "country_name" and "the_geom". "the_geom" is a shape file, special index column. All I want is how to fire a query from openlayer with the help of wfs/vector/other data layer, select the_geom from world_country where country_name = 'USA'

Thanks.

share|improve this answer
    
Here you should post answers to the main questions, not pose other questions. If you have another question, even if similar, you should state it separately –  Andrea Aime Jul 29 '12 at 9:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.