Tag Info

New answers tagged

2

This can be accomplished with an Intersect, followed by a Field Calculate, and then finally a Summary Statistics. Make sure that your buffer feature class has a unique ID field. Before getting started, you will need to add a field (name Polygon_Areas, type Double) to your population polygon feature class, and then field calculate it, using Shape_Area as the ...


0

Using the Area of the polygon only works if you don't have multipart polygons or after exploding multipart polygons and it doesn't fill holes in the polygon, if I'm not mistaken. Have you tried using "Eliminate polygon parts" in ArcGIS (Data Management Toolbox - Generalization)


1

You can use the seventh tool (Select vertex and Object, Rotate Object) of CAD-Tools plugin. An example of use: 1) Selecting feature, rotation point and angle. 2) After rotation of 45 degrees. CadLayer Polygons is a memory layer and it can be saved, for example, as shapefile. Editing Note: I have used this plugin before 2.x QGIS versions where it ...


0

If you want to use the WKT format, the correct syntax is: "POLYGON Z ((398000.0 7542000.0 279.9, 398000.0 7541990.0 281.0, 398010.0 7541990.0 280.4, 398010.0 7542000.0 279.4, 398000.0 7542000.0 279.9))" and not POLYGONZ( but it is very easy to transform your original format to correct WKT poly = 'POLYGONZ((398000.0 7542000.0 279.9, 398000.0 ...


1

Another approach to extract line from polygon and merge line with polygon. Convert polygon to line. Goto: Vector -> Geometry tools -> Polygons to lines. Retain the lines u want and delete the rest of the line. To delete, load the new layer select Toggle Editing then Goto: Edit -> Split features Now draw line on top of line u want to delete new node will ...


2

You are doing good so far. Just try to change the syntax of your polygonz declaration. I did it for you. Here is the complete working code with comments where neccessary: # import shapefile library import shapefile #create an in memory polygon shapefile w = shapefile.Writer(shapeType=shapefile.POLYGONZ) #add a name field to it w.field('NAME') #fill ...


1

Here's an idea, based on using Feature To Line. With ESRI, the tool is only available at the ArcInfo/Advanced license level, but with QGIS I'm sure you can find an version of it. So you could, as I often do, supplement your ArcView/Basic license workflow with free QGIS tools. Run Feature To Line to convert the lake features to lines (make sure you're ...


2

Use an iterator in your model, specifically the Iterate Feature Selection iterator, then use Copy Features to output each feature to it's own feature class. Your model will look something like this: The element called Value temporarily stores the name of the current feature in the iterator. I've also added a variable for a Folder called OutputFolder ...


2

This is imo a great question. If you would be interested in just finding the intersection between two polygons, you'd use the Intersect GP tool and then adding the area of the resultant features back to the wetlands. But you are interested not in intersection yet essentially in the edge, or a segment which polygons share. There is a very nice GP tool in ...


3

Split Layers by Attributes check out this python toolbox. Split Layer by Attributes, county being the attribute you want


6

The name for this kink in a geometry is an "inversion". It is not a topology error per se (as explained in this answer), but it can be an indication of coordinate collapse (such as at the mouth of a harbor, etc.). I can't think of any elegant way to identify inversions. One possible solution (that I haven't tried) would convert the polygon rings to ...


0

Like AndreJ described, I should resave all the layers to a better projection or whatever. But I don't know if this is resolving my issue as I wish. So I now use CSS strokes with some round lines like this: fill: #188; fill-opacity: 0.7; stroke-width: 0.3px; stroke: #188; stroke-linejoin: round; stroke-miterlimit: 2; Yeah not the best or the ...


3

According to the documentation (chapter 7.3), there are several geometry accessors which might meet your criteria, depending on whether the geometry is a collection, a polygon, or a multi-polygon: ST_NumGeometries - If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the number of geometries, otherwise return NULL. ST_NumInteriorRings - Return the ...


3

Use the geometry accessor ST_NumGeometries. For example SELECT ID, ST_NumGeometries(shape) FROM myTable If your geometries contain geometry types other than polygons, you will need to break them up and keep only the polygons before counting. But from your question this would not be required.


0

You should take care when you define new coloumns. When you add a column, choose the appropriate type. Default type is integer, therfore if you fill the coloumn with some other types value ,i.e. string, then it won't be saved.


0

When you create a PostGIS database using create extension postgis the "spatial_ref_sys" table is created automatically. I don't see any use case where you would want to do that by hand. If you are new to the technology, you really need to read some basic literature. Just asking about random details here won't get you anywhere. See for example Getting ...


0

I am not very exerienced, but I would try function geometry ST_MakePolygon(geometry outerlinestring, geometry[] interiorlinestrings);


0

I suppose that you are happy with your script but you may find use for the Spatialite SQL dialect in the future. Let's take a shapefile with one multipolygon to start with. ogrinfo multipolygon.shp -al INFO: Open of `multipolygon.shp' using driver `ESRI Shapefile' successful. Layer name: multipolygon Geometry: Polygon Feature Count: 1 Extent: ...


0

Here is the code I used to get this to work. This is VB.NET code: Public Function SchoolDistrictBoundary() As List(Of List(Of Coordinate)) Dim district As Feature = schoolDistrict() Dim result = New List(Of List(Of Coordinate)) If district IsNot Nothing Then Dim geometry = district.GetGeometryRef() Dim type = geometry.GetGeometryType() ...


4

Maybe you can modify pySkeleton by Olivier Teboul to suit your needs. I haven't had the chance to look at the actual code but from what he says it should be pure Python.


0

Michael's solution above gives the answer Include additional polygons around the borders of the response boundaries of interest (this is to ensure that all areas of the response boundary are contained within one of the created sub-polygons) (or the bounding box) Use Vector -> Research Tools -> Random Points for the ResponseBoundaries layer Vector -> ...


0

Is this a Polygon x Point intersection? If so, your code seems correct. Your picture clearly shows a set of polygons (buildings, in yellowish) and another set of polygons (in red). It's not clear from your question, where the problem is. Is the polygon intersection failing? If that is the case (buffered points, which are in turn, polygons), your code is ...


1

If GISGe's solution works, I'd go for it. Nevertheless, if you still need a solution to remove the holes from polygons, you can just run the union tool and unselect the "gaps allowed" checkbox.


2

With ArcGIS for Desktop Advanced, you could Convert all depression lines vertices to points (with Feature Vertices to Points) Convert all vertices back to lines (with Points to Line, with the Close Line option checked) Revert the direction of all lines (with Flip Line).


0

The closest thing I can think of in QGIS is the menu: Vector > Geometry Tools > Densify Geometries... It will add a given number of nodes between any existing nodes. In the image below I add two nodes (=vertices) extra between any existing nodes.


2

You can group points using either the recursive query or PL/PLGSQL procedure described in the answers to this question. Just substitute ST_DWithin for ST_Intersects/ST_Touches, as appropriate. If you're comfortable trying something experimental, you could build PostGIS with purpose-built functions to solve this problem: see the ticket on trac (code ...


2

I would like to add to vinayan's post and briefly mention the rownum function, as it is very similar and in some cases might be a little more convenient. id returns the Feature ID, meaning that it always starts at zero. rownum returns the number of the row, meaning that it starts at one. So, basically, if you want the auto-increment to start at 0 go ...


0

It works but abit tricky way... $.each(layer.data.features, function(index, polygons) { var coordinates = JSON.parse(polygons.geometry.coordinates); var values = []; var coord = []; for(var i = 0, l = coordinates.length; i < l; ...


0

In order to create a dataset or simply identify which large areas (Councils) have a small area (risk) they are responsible for, you have several options. The simplest is a select by location or spatial query. You're looking for all councils that contain a risk. QGIS and ArcGIS tools may have different spatial relationships available to them. They may even ...


0

If you just want to create a tesselated patch of polygons formed by 3 vertices using all your 1500 points, you can do so with a Delaunay triangulation. Go to Vector -> Geometry Tools -> Delaunay triangulation. Input will be your point layer, output will be your polygon layer. If, however, you have a more specific need in the way these polygons should be ...


0

What you seek is code for segment-segment intersection. I.e., you have a segment (or ray) from O, and you need to intersect it with every edge of your polygon, and then select the closest. (It is generally best to be mindless about this, and just iterative over all polygon edges, rather than try to eliminate edges that have no chance of intersecting.) You ...


0

Field Calculator solution. See first post on how to use: def getFarPoint(shp,n): p=shp.centroid g=arcpy.PointGeometry(p) l=shp.boundary() points=l.getPart(0) m=len(points); lMax=0.0 for i in range(m): pN=points.getObject(i) d=g.distanceTo(pN) if d>lMax: lMax=d;pBest=pN xC,yC=p.X,p.Y xF=pBest.X;yF=pBest.Y pBest.X=xC+(xC-xF) ...


2

If your data is stored in your SQL Server database as native spatial data, you can certainly do this. Assuming your territories (T) and sub-territories (ST) have attributes for their name and/or type, my suggestion would be along the lines of: Create a view (a dynamic table in your database) that joins your two polygons together using a join, where the ...


1

In the javascript code the array is treated as a string so try to parse this sting as json before using , then assign the result to coordinates . So if your result in success function is result , parse its coordinates attribute before using it this is example how to do so : result = { "type": "FeatureCollection", "features": [ { ...


0

Although 'export' is very ambiguous, here's a way to console log the drawn polygon as 'geojson' string. Working from this example, replace the map.on('draw:created') callback with the following: map.on('draw:created', function (e) { var type = e.layerType, layer = e.layer; if (type === 'polygon') { // structure the geojson object ...


0

One option would be to use PHP if your Data is stored in a PostGIS-Database. You could register a click-event, post the click-coordinates to your php and use this coordinate to check for ST_Intersects to get back the feature attributes. would this be an option for you?


8

Edit: originally misread problem. Basic license workaround (Advanced license alternative: Erase) below: Union both layers Edit, select (those where FID_circleLayer <> -1 and FID_parcelLayer = -1, using selection type "are within (Clementini) the source layer feature") and delete.


1

I'd say clip the parcels to the Circle, then: In both ArcGIS and QGIS you can use the Symmetrical Difference tool. The ArcGIS tool will require an Advanced/ArcInfo license. The QGIS tool is free!


3

It depends on your license. If you have an advanced license you should have a tool called Erase. Use this tool with both of your datasets and you will get the correct result. If you do not have that tool, please let me know, and I will edit my answer to explain a workaround! EDIT: For those who do not have access to the Erase tool with their license, here ...


1

Assuming I'm understanding the question correctly, this can be easily achieved using FME and the Generaliser transformer. If you use the "Thin" (or maybe "ThinNoPoint" depending on your use-case). This will remove any points that are more than 5km from the next. ...


0

To remove duplicates: You can use the Delete duplicate geometries tool by accessing it via the Processing Toolbox: Another option is to use the v.clean tool from GRASS and select the rmdupl option: To remove overlaps: You can use the Dissolve tool, provided there are common attributes between the original polygon and the overlapping polygon: As ...


0

The getFeatureInfo should work, asking for both layers you'll get all the features that intersects the requested pixel. If you receive features from both layers then that's your success condition. It's not perfect because is based on pixel area, not an exact position, but only with WMS that's all you got.


0

Field Calculator version. Add fields X and Y to polygons table Run getFarPoint( !Shape!,0) on field X Run getFarPoint( !Shape!,1) on field Y code block: def getFarPoint(shp,n): p=shp.centroid g=arcpy.PointGeometry(p) l=shp.boundary() points=l.getPart(0) m=len(points); lMax=0.0 for i in range(m): pN=points.getObject(i) d=g.distanceTo(pN) if ...


5

Here's a pared down version of @crmackey's answer. The polygon layer is called 'POLY1', and should be the only thing you need to change to get an output point file of farthest vertices - it creates centroids on-the-fly: >>> points = [] >>> with arcpy.da.SearchCursor("POLY1",['SHAPE@']) as cursor: ... for row in cursor: ... ...


1

This worked for me. The script will create an output point feature class that returns the point that is farthest from the centroid for all polygons: import arcpy import os import sys import traceback import math from datetime import datetime as d arcpy.env.overwriteOutput = True def Message(msg): print str(msg) arcpy.AddMessage(msg) def ...



Top 50 recent answers are included