Tag Info

Hot answers tagged

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 ...


8

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 = ...


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 ...


7

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


7

Filtering (ie. using Layer / Query or the Query Builder in layer properties) in QGIS justs adds a where clause to the query that is executed. So that shouldn't be different to you want to do "in" PostGIS. Although I'm not sure what you intent to do there.


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 ...


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

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 ...


3

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: ...


3

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 ... ...


3

Officially, OpenLayers only supports SLD version 1.0.0 for now (patch welcome). I'm not sure this version of the SLD standard officially supports Filters version 1.1.0. That's the official standard point of view. In the real world however, your WMS service probably do support it. So to force OpenLayers SLD version 1.0.0 to use Filters version 1.1.0, you can ...


3

I got good results with mDenoise. This tool uses the Sun's denoising algorithm which removes noise without filtering sharp edges like ridges or peaks. Good for mountainous areas especially high mountains. You can define the threshold and the number of iterations. You have to try something around to get the best result. Before denoising ASTER GDEM2: After ...


3

For shapefiles you should write "mapserver style" filtering expressions, e.g. layer.setFilter("([id] = 1)") The syntax you are using would be OK for RDBMS backends only (passed to a SQL where clause)


3

You're going to have to iterate. It's a logical AND and it takes an array of filters. If you think it looks ugly create a function that will return the array of filters given your values.


3

Some GPS hardware/subsystems in modern smartphones implement Kalman Filtering and sensor fusion. For example, this is the system log output (edited for relevant portions- full dump is here) from a Samsung Galaxy S3 with Android 4.3 after I fire up the LocationListener, when listening to the GPS_PROVIDER. Here you see the app (GPS Benchmark) listening for ...


3

Using Erdas, the Sieve tool is located: Raster tab > Thematic (Raster GIS group) > Sieve Also, a widely accepted approach is to use GDAL's gdal_sieve.py, describes as follows: The gdal_sieve.py script removes raster polygons smaller than a provided threshold size (in pixels) and replaces replaces them with the pixel value of the largest ...


3

Following up on the Comment by @whuber, the Majority Filter (Spatial Analyst) documentation says (with my bolding): The input raster to be filtered based on the the majority of contiguous neighboring cells. It must be of integer type.


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

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

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

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

In QGIS you should be able to filter your data with an SQL expression in the Query Builder dialog. Just right click your layer in the table of contents and select "Query".


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

To hide features for( var i = 0; i < features.length; i++ ) { features[i].style = { display: 'none' }; } layer.redraw(); To display back the hidden features for( var i = 0; i < features.length; i++ ) { features[i].style = null; } layer.redraw();


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

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

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 ...



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