Hot answers tagged

11

which layer do you want, i dont understand? but getting all layer: map.layers getting all layer name: var mLayers = map.layers; for(var a = 0; a < mLayers.length; a++ ){ alert(mLayers[a].name) }; getting last added layer name: map.layers.getLast().name and beside this you can use all this method too: 1.map.getLayer() 2.map.getLayerIndex() ...


7

In OpenLayers, you can generate filters programmatically using the OpenLayers.Filter classes. These can be used in conjunction with the vector layers using the WFS protocol to be serialized with OGC Filter Encoding. We have a filter example demonstrating filter serialization and several examples demonstrating the WFS protocol. If a vector layer has a ...


6

Which mapserver are you running/requesting maps from? According to Geoserver CQL Tutorial: CQL provides a full set of geometric filter capabilities. Say, for example, you want to display only the states that do cross the (-90,40,-60,45) bounding box. The filter will be BBOX(the_geom, -90, 40, -60, 45)


5

Thanks for reply. I didn't know this log file. Really a great help! Here is the solution for my problem: http://myserver:8080/geonetwork/srv/eng/csw?SERVICE=CSW&version=2.0.2 &REQUEST=GetRecords&resultType=results &constraintLanguage=CQL_TEXT&constraint_language_version=1.1.0 &constraint=TempExtent_begin%20>=%20'2014-10-12T00:00:00Z' ...


4

No. The list of valid parameters is here. CQL_filter is a geotools "vendor parameter". Vendor parameters are options that are not defined in the official WMS specification, but are allowed by it. The danger in using it is that no client is obligated to use it, or even to acknowlege that it exists. ArcGIS does expose a query interface using a web form, ...


4

You have not posted a complete example of the url you are building and sending to GeoServer so it is difficult to know for sure what the problem is. However, I suspect the problem lies in the use of the % for the wildcard. In a url the % character has a special meaning as it is used when certain characters should be encoded. For example, you may well recall ...


4

As far as I know these are not supported by anyone else as they are a vendor specific parameter that is added by GeoServer. I also don't believe there is anyway to determine the vendor specific parameters from the capabilities request.


3

http://***/geoserver/Kaski/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Kaski:PIN&maxFeatures=50&outputFormat=json&featureID=97 not use cql_fiter it is working. thanks anyway


3

There is no way to do that. If you want to get the highest value of a filed you have to use WPS, GeoServer has a process that does basic statistics on fields, including the max value.


3

You can use WFS GetFeature, either encoding the filter in CQL or Filter. Something like: http://host:port/geoserver/wfs?service=WFS&version=1.0&request=GetFeature&typeName=myLayer&CQL_FILTER=INTERSECTS(the_geom, POLYGON((...)))&propertyName=data1,data2,data3 more here: ...


3

CQL filter is a vendor parameter provided by GeoServer, therefore you have to include the cql_filter in the params string object. OpenLayers 3's ol.source.TileWMS object only supports options you can see in the corresponding API page. Also, in OpenLayers 2 you had to include cql_filter in the params object. Because of its limited input options, you didn't ...


3

Figured it out! The following SLD uses a rendering transformation to call "gs:Clip", which clips vector features to a bounding geometry. The result is then rasterized by GeoServer's WMS. <?xml version="1.0" encoding="UTF-8"?> <StyledLayerDescriptor version="1.0.0" xmlns:ogc="http://www.opengis.net/ows" ...


3

POLYGON((-90.89 46.67,-90.89 46.67,-90.89 46.67,-90.89 46.67,-90.89 46.67)) Looks like WKT. If it is, you can convert features/layers/geojson to WKT using Wellknown or Wicket-Leaflet


3

It's likely the axis flipping biting you, you should flip coordinates in WFS 1.1 and 2.0 filters: http://docs.geoserver.org/stable/user/services/wfs/basics.html#axis-ordering


2

If you only ever need to talk to GeoServer then CQL is easier to create and understand. If you intend to talk to any server out there then stick with the OGC Filter spec as there is more chance that a random server will implement that. AFAIK there is no functional difference between them at the server end, certainly GeoServer will convert them into the same ...


2

One approach would be to use the OGC Common Query Language (CQL) to generate your expressions and then use the OpenLayers CQL parser to convert to an OGC Filter. A description of the process can be found here.


2

I don't know for GeoNetwork, but a CSW compliant request should probably look more like the following: http://serverurl/geonetwork/srv/en/csw? REQUEST=GetRecords& SERVICE=CSW& VERSION=2.0.2& namespace=xmlns(csw=http%3A%2F%2Fwww.opengis.net%2Fcat%2Fcsw%2F2.0.2)& OUTPUTSCHEMA=http://www.isotc211.org/2005/gmd& ...


2

It seems you are using the cross layer filtering plugin: http://docs.geoserver.org/stable/en/user/extensions/querylayer/index.html Did you read and apply the hints in the "optimizing the module speed" section? The hint is needed only for the 2.1.x series, the 2.2.x won't benefit from it


2

did you pass the CQL filter to the WMS GetFeatureInfo request too? If not then any record in the whole dataset at that location will be returned.


2

On your second question: An SLD can be created dynamically, which means it can style maps using dynamic data. For this to work you will need to know the IDs of the polygons you're trying to style and you also need to alter / expand your web service. Have your web service generate SLDs on-the-fly instead of just returning data. This is simple enough using ...


2

For the moment I have solved this via a bodge. The Java side of the application that is generating the CQL knows how many ID's are in the table in total so if the number of ID's selected by the user are less than half the total in the table a CQL 'IN ()' query is generated as normal. If the number of ID's selected by the user is more than half the total, ...


2

you have to declare that you use EPSG 3301 and not EPSG 4326 for the BBOX with wfs in version 1.1.1.: " If the crsuri is not specified then the 2-D coordinates shall be specified using decimal degrees and WGS84" ( http://augusttown.blogspot.de/2010/08/mysterious-bbox-parameter-in-web.html ) Just add a crsuri at the end: ...


2

Often even if filters or pagination are not supported, you can use the BBOX parameter to query features limited to a specific region. Via trial and error this can give you all the data. Just slice the area of interest into BBOXes that return less features than what the WFS is limited to. For example &BBOX=395000,5815000,400000,5820000 for a part of ...


2

Since this has not been answered. Here is my own solution which is very simple and works well. The "update" function clears the vector source. The "loader" function, which has been added to the vector source, will then automatically update the features using the url. var vectorSource = new ol.source.Vector({ loader: function (extent, resolution, ...


2

Try this: var FilterWMSlayer= L.tileLayer.wms("http://Server.com/geoserver/Workspace/wms", { layers: 'Workspace:Layer', format: 'image/png', transparent: true, CQL_FILTER:'NAME=Leeds' }); EDIT In case you want to query more params: CQL_FILTER:'param=value&param1=value1&...' EDIT 2 I've updated your ...


1

Since you are using GeoServer, you can use strToLowerCase() function, while passing the search term in lower case as well. The following code should work: var filter_c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.LIKE, property: 'strToLowerCase(p_name)', value: ...


1

You can ask for two layers in your WMS request - one with all the parcels drawn (use your usual or a default style) and a second with the filter and a different style specified. The url will look like normal but for layers=parcels,parcels&styles=,red&cql_filter=;ParcelID=1 Note the ; at the beginning of the filter to show there is no filter ...


1

The same issue has been well answered in this question. But here is a quick answer, the reason is that by the time you call pins.getDataExtent() the wfs protocol has not finished reading all the features, so the _CallBack has not been executed. In your case you may zoom to layer's data extent after add features to the layer, i.e. in _CallBack function after ...


1

Assuming that you are running GeoSolution's fork of Mapfish then the code you have there will work. So I would suspect that there is some issue with your setup as even if you are running the stock set up all it does is ignore your CQL Filter.


1

Following Dynamic SLD styling - unique colours for linestrings I would suggest adding a "color value" column to your postGIS table is the easiest solution. The column should always be updated with respect to the current range of GDP values. Then, you might access it in your SLD with a PropertyValue in the CssParameter tag.



Only top voted, non community-wiki answers of a minimum length are eligible