New answers tagged

1

I answer me myself. I don't like, but I only found this solution: I have used conditional function in label expression. "if" has 3 arguments (condition, label if true, label if not) This is the correct code from PyQt4.QtGui import QColor layer = iface.activeLayer() palyr = QgsPalLayerSettings() palyr.readFromLayer(layer) palyr.enabled = True ...


0

If I understand what you want then it should be a simple filter like: Rule rule = sb.createRule(textSymbolizer); rule.setFilter(sb.getFilterFactory().greater( sb.getFilterFactory().property("traffic"), sb.getFilterFactory().property("current_trafic"))); FeatureTypeStyle fts = sb.createFeatureTypeStyle("Feature",rule);


0

As an afterthought, another way of achieving this is manually adding a row in edit mode, copying the attribute data from the point feature to the new row, and then deleting the original point feature. It's crude, and time consuming, but hey, it works.


0

I read about connection pooling and found that I only need to close the "parent" connection. finally { if (itr != null) itr.close(); if (con != null && !con.isClosed()) con.close(); }


0

You shouldn't be opening your own connections, let GeoTools manage that for you. I have used the following code (with a PostGIS connection as I don't have Oracle installed) and it is fine. The main trick is to make sure you close your featurereaders/featurecollections/iterators, otherwise they will hang on to a connection until they are garbage collected. ...


5

Here is an even easier alternative to setting all geometries to NULL. For this to work you need to be in edit mode if you are processing a GeoDatabase FeatureClass. This example shows how to set polygons to NULL For a point dataset the expression needs to be: arcpy.Point() For a polyline dataset the expression needs to be: ...


3

You can write an update cursor that replaces the shape field with NULLS. The following ArcPy works for a point geodatabase feature class at 10.3.1. import arcpy FC = "C:\\Data\\GIS\\My.gdb\\AreaOfInterest" newPnt = arcpy.Point() fieldList = arcpy.ListFields(FC,"","Geometry") for field in fieldList: print field.name cursor = arcpy.UpdateCursor(FC) ...


0

I've found a sample answer. Just find the available layers in the map and apply a filter for each layer separately. Following is the code I used. MapContent con = mapPane.getMapContent(); con.layers(); for (Layer l: con.layers()) { FeatureType schema = l.getFeatureSource().getSchema(); String geometryPropertyName = ...


1

I've followed selection lab of geotools. Source here. It would be an answer for this question.


3

looking into this example i would go for a statistictsCalculator grouping by id , attributes to analyse your columns


2

You can use IPointCollection this way: public void IterateVerticesIPointCollection(IPolyline line) { // Cast the polyline to IPointCollection IPointCollection pointColl = (IPointCollection)line; // Iterate the array... for (int i = 0; i < pointColl.PointCount; i++) { IPoint point = pointColl.get_Point(i); // ...and do ...



Top 50 recent answers are included