Hot answers tagged filter
8
The GRASS equivalent of a majority filter can be computed with the r.neighbors command (help page). To get a simple majority filter, something like this should work, using a 3x3 window:
r.neighbors input=input_layer output=majority_filtered_output method=mode size=3
But r.neighbors supports many other options in addition to this. Depending on what you're ...
7
Are you trying to do this in near real time with telemetry feedback to an R/C controller, or against a datalog after recovery?
Either way have a look at your datastream or datalog file. Depending on the brand of GPS and type of data logging you might have full NMEA sentences, or just abreviated fixes to work with. If NMEA 183 sentences look ...
7
To read a filter from a string should look something like:
var my_filter_xml, parser, xml;
parser = new OpenLayers.Format.Filter.v1_1_0 ();
xml = new OpenLayers.Format.XML();
my_filter_xml = '<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo ...
6
Ah. In that case, you could use GeoServer's WMS CQL filter support, i.e.:
http://<hostname>/wms?service=WMS&version=1.1.1&request=GetMap&....&cql_filter=IN ('id_1','id_2','id_3')
More information is available at http://geoserver.org/display/GEOSDOC/WMS+vendor+parameters
5
Use the methods available on the ISQLSyntax interface to make your code workspace-independent.
As the help on IQueryFilter.WhereClause explains, use the ISQLSyntax.GetSpecialCharacter method to return the delimited identifier prefix and suffix specific to your workspace and add them to your column identifiers.
Example:
ISQLSyntax sqlSyntax = ...
4
Use Focal Statistics weighted kernel file to omit the central cell with the format:
3 3
1 1 1
1 0 1
1 1 1
See example of ASCII weighted kernel file in the help topic How Focal Statistics works. Save as *.txt.
The only statistics available with this neighborhood are mean, std, and in this case sum (useful on binary rasters of each landcover value - so ...
4
On a simple level, if you define a bounding box for the Czech Republic you can construct an SQL query to test if the X and Y coordinates are within the maximum and minimum coordinates of the bounding box.
The query would be something like:
SELECT * FROM [TABLE] WHERE
[X_FIELD] BETWEEN [BOUND_XMIN] AND [BOUND_XMAX]
AND
[Y_FIELD] BETWEEN [BOUND_YMIN] AND ...
4
In QGIS you have the raster calculator (Under the "Raster" menu) which will do what you want. (not a shell script command)
Load your Globcover raster into QGIS, and open the Raster Calculator.
The raster will appear in the "Bands" window.
Enter a name for the new "Output Layer".
Now double click on the Globcover band name so that it appears in the lower ...
2
You could pass a list of feature id's in the following manner:
GET:
http://<hostname>/wfs?service=WFS&version=1.1.0&request=GetFeature&typename=foo&featureid=id_1,id_2,id_3
POST:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature version="1.1.0" outputFormat="text/xml; subtype=gml/3.1.1" service="WFS" ...
2
What i can see from Openlayers source code only BBOX and INTERSECTS filters only implemented. Have a look at the evaluate() method.
You could use WFS getFeature call with CQL filters to filter the features at server or if it is only display purpose, SLD could be implemented with DWITHIN filter. (http://trac.osgeo.org/openlayers/ticket/1543)
2
I think you want to apply definition queries to accomplish what you're after. Do a read-up at the link I pasted. It's a very simple technique that's handy for this type of thing. I hope this helps.
2
If your goal is to know WHEN all features have been added to your wfsLayer so you can hide your "please wait" message, then you could do as neil says and add it all in the vector layer constructor. Then just register the featuresadded event which will be triggered when the features have been added.
Example:
wfsLayer.events.on({
featuresadded: ...
2
IToplogicalOperator.Boundary returns a polyline if the input geometry is a polygon. You probably don't want that (selecting cities by the boundary/perimeter as opposed to the the interior/area of a state makes no sense), so just return the feature's Shape or ShapeCopy.
Also it's good to know the difference between these, and between a recycling and ...
2
http://docs.geotools.org/latest/userguide/library/cql/cql.html
So the third parameter would be something like:
INTERSECTS(ATTR1, POLYGON((... )) )
The polygon has to be expressed in the WKT syntax and be in the same SRS as the layer being queried. Either that, or get a recent GeoServer version and call setSRS(POLYGON(...), 'EPSG:xywz') around the WKT ...
2
I'm not sure, but this trick may work:
Add FILTER to validation block of the layer's description, like this:
LAYER
...
VALIDATION
'FILTER' '.'
END
...
When you want to show all of the data in your layer, add the following string to your URL request :
&map.layer[mylayer]=FILTER+("[mycolumn]"+~*+".")
I hope this will help.
2
It's my understanding that you need to change the display property of style:
features[i].style.display = 'none'; // hide
or
features[i].style.display = ''; // show. Set to anything but 'none'
Then you need to do a redraw on the layer after changing the vectors in it:
affectedlayer.redraw();
Of course.. I'm having trouble with this now too ( which ...
2
If setting a DEBUG 5 on both your LAYER and MAP objects, and also add CONFIG MS_ERRORFILE "ms_error.log" in your MAP object. You should be able to see more about what's going on.
You should be able to see the temp mapfile being created to execute your query. You should also be able to see the postgresql query built to fetch your records, which you could ...
2
It is a challenge to solve this one without creating (possibly a great number of) indicator grids, one per classification, and then carrying out a lot of expensive reclassifications and conditional calculations. Here's one way.
I interpret the question as asking to identify cells in which at most one of their eight neighbors has the same value as the cell ...
2
You can use v.in.ogr to import PostGIS vectors into GRASS, and use the "where=" option to filter out only those rows you want.
Additionally, if you set the database connection in GRASS to postgres, then the attribute table will be stored back into the Postgres database, and the vector geometry will be stored in GRASS for further analysis. So (copied from the ...
2
To do the bounding box you need a polygon of the city in the same coordinate system as your current data
USING QGIS
Go to either Vector>Research Tools->Select by location or Plugins>Spatial Query and select the options.
Vector>Polygon layer extent and make a polygon of the full extent. Then follow the steps in option 1 above using your new polygon.
1
You are using the JavaScript switch - case construct incorrectly. You need to add a break statement at the end of each case block, e.g.
switch (f) {
/* ... */
case 'type_2':
if (checked) {
filter('show_type_2');
} else {
filter ('hide_type_2);
}
break;
case 'shape_1':
if ...
1
A working solution is similar to what @seruva19 suggested. The trick is to add a boolean value to the filter as an alternative to the previous filter:
FILTER "(mycolumn='%myvalue%') or %allvars%"
where the validation forces the value to be TRUE
VALIDATION
...
"allvals" "^TRUE$"
END
and the default of allvals is set to FALSE
METADATA
...
...
1
Have a look at two papers from Nokia's Mobile Data Challenge 2012 Workshop:
MobReduce: Reducing State Complexity of Mobility Traces by Fabian Hartmann, Christoph P. Mayer, Ingmar Baumgart, Karslruhe Insitute of Techology (link).
and
A Trajectory Cleaning Framework for Trajectory Clustering by Agzam Idrissov, Mario A. Nascimento, University of ...
1
The first is not an option, layer groups exist only for WMS.
Cross layer filtering is to filter layers, not to get multiple ones in one request.
If you need data from more than one layer in WFS just create a Query element for each one of them in the request, as mandated by the WFS spec, or if you are using a GET request use a comma separate value.
A quick ...
1
i would recommend that you see this example of filtering strategy for openlayers.
this snippet from original code:
filter = new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.BETWEEN,
property: "when",
lowerBoundary: startDate,
upperBoundary: new Date(startDate.getTime() + (parseInt(spanEl.value, 10) * 1000))
});
var flights = ...
1
You need to check what geometry types the WFS server supports. Do a GetCapabilities request and check //ogc:GeometryOperands, which provides a list of supported geometry types.
Update: as well, make sure your WFS GetFeature request has proper referencing to namespaces, and of geometry types.
...
1
Use Vector layer instead WFS. The vector layer accepts some properties like:
protocol: which allows to set the kind of protocol to be used to read/write data. It can be WFS, GeoJSON, ...
strategies: an array with the Strategy instnaces used to refresh the layer content.
filter: this is what you want. Here you can specify the filter to be use when ...
1
If you apply a Definition query in ArcMap (as @Dano suggests above) it's exported to ArcPad as a Filter meaning all records are present but only those which pass the filter criteria are displayed.
As far as I can see Filters in ArcPad act in pretty much the same way as Definition Queries in ArcMap, except that Filters also have the @##MAPSCALE## variable. ...
1
I understand the head ache when constructing a whereclause but in VB I have recently adopted the approach of using the VB function CHR() when dealing with File geodatabase fields which need to be enclosed in double quotes.
So to make the clause string: ""ID" = 6" I would do it as:
pQueryFilter.WhereClause = chr(34) & "ID" & chr(34) & " = 6"
...
1
Having looked at the source code I also think that the DWITHIN filter is not (yet) implemented in OpenLayers V2.11 .
One has to be clear though about the two different uses of filters: If used as a Strategy for a vector layer, it is handled by OpenLayes on the client (and there DWITHIN isn't available yet). If however the same filter is used as an option ...
Only top voted, non community-wiki answers of a minimum length are eligible

