Hot answers tagged

5

@Caleb if you use the Spatial Join (Analysis) tool, you can click on fields that pop up in the 'Field Map of Join Features (optional)' portion of the tool window. While a field is highlighted, click on the 'X' to the right and it will delete from view (and therefor not show up in your Join output feature class). Also, you can set join rules for certain ...


4

1) If your pnt shapefile has only one element, use the iterator method next(): feat = pnt.getFeatures().next() pntxy = feat.geometry().asPoint() If the shapefile has many elements, use list comprehensions pntxy = [feat.geometry().asPoint() for feat in pnt.getFeatures()] # select pntxy[0] or pntxy[1] or... 2) instead of GDAL, why don't you use directly ...


3

You just need to turn on map tips.


2

I have found a suitable solution to the question I asked earlier. To do this I used the Convert Geometry Type function from MMQGIS plugin (the plugin must be installed). MMQGIS → Modify → Convert Geometry Type From the window I chose the layer(line type) and chose New Geometry Type (this has several options) I used Centroid and selected the Output Shapefile. ...


2

The problem probably could be here: . . . out_rst.SetGeoTransform(g_x_min, g_pixelWidth, 0, g_y_max, 0, -g_pixelHeight) . . . because 'SetGeoTransform' method needs a list as parameter. Try out this: . . . out_rst.SetGeoTransform( [ g_x_min, g_pixelWidth, 0, g_y_max, 0, -g_pixelHeight ] ) . . . I hope that it helps Editing Note: I tried to ...


2

If you want to perform a selection for each row, as your script indicates, you need to convert your point object to a geometry object. Here's a very messy line of code that will do so: arcpy.SelectLayerByLocation_management('ptLayer','intersect',arcpy.Geometry ("point", row[0].firstPoint, arcpy.Describe ('Build2035').spatialReference)) If you want to ...


2

Include fill/color in your aesthetics mapping: ggplot() + geom_polygon(data = tz.prj, aes(long, lat, group = group), fill = "#f1f4c7", color = "#afb38a") + geom_point(data = tz.c, aes(lon, lat, fill = "Hospitals"), pch = 21, color = ...


2

When you switched the CRS did you do a 'save as' (required to reproject)? If you just changed the CRS in the layer properties you won't actually reproject and will see features moving. If this is the case, you'll need to first set the CRS back to the original in layer properties, then do the 'save as' to reproject to your desired CRS.


2

My suggestion is based on a method I apply to group smaller subcatchments into larger. There are no streams, thus 1st step to compute Euclidean minimum spanning tree: I guess it is some sort of optimisation already. Pick your sink and create directed graph. Picture below shows "Flow Accumulation" in links, i.e. count of nodes discharging into it: ...


2

You have to change 2 things in your query: add an alias 'geom' right after 1, 1, NULL))


1

Try to "Select by expression" under Geometry you will find $xand $y to build the expression you need. You can then use "Save As" and check only selectet features to save the selection to a new file/shape. edit: I missed the arcmap label, still this should be possible there too.


1

Try this version (modified from gene's response): vl = QgsVectorLayer("Point?crs=", "temporary_points2", "memory") vl.dataProvider().addAttributes([ QgsField("X_coord", QVariant.Int), QgsField("Y_coord", QVariant.Int), QgsField("Azimuth", QVariant.Int) ]) new_features = [] for row in range(0,rows): for col in range(0,cols): rspnt = ...


1

From ESRI Mapping Center: The default symbology can be changed using the Advanced ArcMap Settings Utility. This executable file is usually found in your C:\Program Files\ArcGIS\Utilities directory. Just navigate to that directory, double click the AdvancedArcMapSettings.exe file and the ArcMap Advanced Settings dialog will open. Click the ...


1

To dump only unique points, you could use a few subqueries with a SELECT DISTINCT ON expression: SELECT geom, gid, path FROM ( SELECT DISTINCT ON (geom) geom, path, gid FROM ( SELECT (ST_DumpPoints(the_geom)).geom, (ST_DumpPoints(the_geom)).path, gid FROM my_linestrings_table ) f ORDER BY geom, path, gid ) f ORDER BY gid, path;



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