0
votes
2answers
68 views

Python library or algorithm to generate arc geometry from three coordinate pairs?

I'm trying to write code to generate fixtures for a django/geodjango project. I need to generate geometry for arcs (line string) given three lat/long pairs; start of arc, end of arc and centre of arc. ...
0
votes
1answer
68 views

using Z and M feature geometry to create line graph in Python?

I am a Python (v2.6.5) noob trying to plot a series of 3D polylines into graphs. So far I've come up with: # Import system modules import arcpy, os, sys, string from arcpy import env ...
1
vote
1answer
52 views

Locating 0-points multipart polygons using arcpy

By Running this piece of code: import arcpy arcpy.env.workspace = "C:\working\GEODATABASES\\tests.gdb" fcList = arcpy.ListFeatureClasses() for fc in fcList: with arcpy.da.SearchCursor(fc, ...
1
vote
1answer
24 views

ogr: what is the advantage of using `geom.Clone()` over `geom`?

What is the advantage of using geom.Clone() over geom? Simple example: geom = link_feat.GetGeometryRef() newfeature.SetGeometry(geom.Clone()) # or newfeature.SetGeometry(geom) ...
0
votes
0answers
59 views

TileStache : Unknown geometry type in geoJSON file

I'm currently trying to set up a TilSstache server on Ubuntu 12.04 to serve some GeoJSON tiles from a shapefile/JSON file (administratives boundaries) for a web mapping project using the Leaflet ...
0
votes
1answer
60 views

How to disable “Simplify geometry” via Python?

After I've loaded a layer from a table in my db I'd like to disable the 'Simplify geometry' (found in Layers/Properties/Rendering) programatically using Python. I've tried several versions of ...
2
votes
2answers
355 views

How to draw polygons from the python console?

I've been visiting and revisiting the page on geometry handling in the PyQGIS Cookbook: https://www.qgis.org/en/docs/pyqgis_developer_cookbook/geometry.html but can't seem to figure out how to get the ...
0
votes
0answers
21 views

Is there a way of converting polygon vertices to points using GDAL python? [duplicate]

I have an ArcGIS standard license and I want to convert polygon vertexes to points in a script. Since I don't have a good enough ArcGIS license I've been using ET Geowizards to get the points. The ...
1
vote
2answers
152 views

Get the vertices on a LineString either side of a Point

I have a shapely LineString and defined a shapely Point which lies along the LineString. How can I find the vertices of the LineString which lie either side of the point? (split the line in two). ...
5
votes
2answers
579 views

How to convert geoJSON to python objects?

New to the site, and to geoJSON, and to python. My goal is to read in a file with geoJSON data, and use it to generate shapes to be used in an application that is using python scripting. Python has ...
6
votes
1answer
190 views

Draw middle ordinate perpendicular to chord, out to curve, with arcpy

I've been assigned to find the radius of road curves. My boss found this article describing a pretty straightforward method of doing so: find the start/end points of the curve; create a chord; ...
1
vote
2answers
295 views

Convert 3D WKT to 2D Shapely Geometry

I have the WKT of many linestrings which contains three dimensions, however my script only requires a two dimensional linestring and I therefore want to discard the third dimension. My current code, ...
0
votes
1answer
202 views

SetGeometry problems when using python/ogr

So i am trying to use the difference function and i pretty much create the new file i want but the Geometry is empty. No error is produced. any help would great! Thanks. #!/usr/bin/env python import ...
2
votes
3answers
308 views

Polyline selection of features with angle turns up to a specified angle

I'm looking for an automated way to select line features that have specified angle between vertexes. That in order to check water mains layer -steel pipes can have only 45 or 90 degrees turns and I ...
2
votes
1answer
248 views

Programmatically manipulate GPX data

I need to do the following in Python open OSM & GPX files (I have packages for this) transform points from GPX (like stick a track to roads) calculate the results (distances, cumulative ...
2
votes
1answer
281 views

How to perform a cascaded combine from python script in QGIS?

I'm working with a large dataset, and I need to be able to combine up to 400,000 polygons. I have been using the QgsGeometry::combine(QgsGeometry* geometry) function and simply looping over all ...
4
votes
0answers
635 views

Finding the “center of gravity” of multiple points where points have unequal weights [closed]

I'm trying to reduce a set of lat/lons (each with it's own weight) into one lat/lon that is the center of mass of all of the points. however when I map the results the average point falls no where ...
2
votes
1answer
289 views

Combining polygon geometries with python and QGIS segfaults

I am trying to combine polygons, using Qgis 1.8, and every time I run this script in the python console, I get a segmentation fault. Here is the script: from PyQt4.QtCore import * iface = ...
0
votes
1answer
149 views

QGIS Python - Convert geometry from Postgres to QgsPoint()

I have made a query in Postgres to get some points to use with python. This points are in geometry data. How can I convert that geometry in decimals to use QgsPoint() in python? Thank you
1
vote
0answers
87 views

Python GDAL/OGR: check lines geometries connectivity

I'm working with shapefiles representing roads, so basically it's stored as (poly)lines. I need to perform a road connectivity checking. In other words, I want to ensure that roads meant to ...
2
votes
1answer
359 views

How to get point x and y geometry from a shapefile?

I have a shapefile of US Cities and I want to get the X and Y coordinate of EACH city in that shapefile. I've tried this: for city in city_cursor: geom = city.Shape point = geom.getPart() ...
2
votes
1answer
656 views

How to write point geometries with arcpy instead of gp syntax?

Can someone help me fix some code that simply writes points into a featureclass? It used to work in the older gp. syntax, but I'm having difficulties rewriting it in arcpy for ArcGIS 10.0. In this ...
2
votes
3answers
190 views

How to test if geometry is inside another?

I need to tell whether geometries from a shapefile are inside other geometries or not. For example, I want to test if there are trees (represented as points in trees.shp) inside the urban areas ...
5
votes
1answer
271 views

How do you fix Overlapping Lines?

I have a line dataset that contains some lines where the "end points" are actually found in the middle of the line. In the image below, the nodes are shown in green and one of the end points in red. ...
5
votes
1answer
642 views

Python: find a method to calculate the “inner centroid” (also known as labelPoint in arcmap) of a polygon

i am looking for a method to compute the X,Y coordinate of a inner point (also known as labelPoint in arcmap) of a (irregular) polygon. I am try to find a solution without the use of ArcGIS module ...
2
votes
2answers
530 views

Updating polygon geometry: deleting inner rings with python

I've searched, but can't find clear explanations how can I simply delete inner rings from existing polygons with python or extract outter rings and overwrite the geometry. Seems GDAL/OGR should be the ...
3
votes
1answer
883 views

How can I create an empty feature class in a file geodatabase based on the schema of an SDE feature class?

I have 150+ feature classes in SDE for which I need to create an empty feature class in a file geodatabase. For these feature classes I need to import the attributes and the name of the feature class ...
1
vote
1answer
980 views

How to create multipart line and polygon with interior ring in ArcGIS Python?

My objective is to swap X,Y coordinates of feature classes using Python and arcgisscripting. Based on help examples, I managed to write script which reads and writes all geometry types. The problem ...
2
votes
1answer
416 views

The minimum bounding circle of geometry that crosses the 180th meridian

Background: I've been given a task where I have to calculate the minimum bounding circle of Alaska (for the purpose of running a Roeck test). I'm using the Census' state level geometries available ...
5
votes
5answers
1k views

Python, shapely library: is it possible to do an affine operation on shape polygon?

I am trying to create a rotated rectangle in lat/lon coordinates. Basically I have the coordinates of the center and rotation angle around the center. Is it possible to do using, shapely or gdal, or ...
9
votes
2answers
5k views

Using python in ArcGIS, create a line of varying distance from an origin point

What I'm trying to do is create a line feature from a single point, using a set distance and angle. Using ArcGIS and Python (I hope). Here's the scenario: Say I have a point at these coordinates: ...
7
votes
3answers
2k views

How to create a circle in arcpy

Suppose I have a dataset where each record has an x,y and r (the centroid and radius of a circle). How can I create a polygon feature class containing parametric circles? Sorry to those who have a ...
10
votes
2answers
3k views

Point (of a linestring) within Polygon using ogr and Python

I'm currently working on a project in which I need to build a topological network out of the geometry features I find in shapefiles. So far using Ben Reilly's open source project I've managed to ...
9
votes
1answer
6k views

How to create a script tool that will create a copy of a feature class and offset it by a given distance? (arcpy)

I want to duplicate a polygon feature class and offset all of the polygons by about 10 feet in both the x and y directions. I asked if there was any way to do this last week, and I was informed that I ...