Tag Info

Hot answers tagged

25

This problem has many valid solutions. One of them works a little like your description, but instead of slicing the polygons at "random" locations you can do it purposefully in a way designed to minimize the amount of computation. Here is the basic algorithm. Its input consists of any plane sweep direction, a polygon P of nonzero area, a target area a ...


22

A quick and dirty method is to draw the shadows of the building roofs only, render them in dark gray (preferably semi-transparent if there are any underlying ground layers), and draw the building polygons over them. The roof shadows are obtained by translating the building polygons by the distances determined by the building heights in the direction ...


20

That convention goes back to the surveying industry; which has a point of beginning. So you start at a point in space, and the last point you reference is your closing point. This way you have a closed object. So to build a full COGO object you need to have a complete description of what is being described. Its more accurate than a assumed close.


13

We need to bear in mind that these data are samples of discrete lithologic domains. Often, the boundary between two such domains cannot be identified in the field and so it's not valid to expect that many of the sample locations will lie precisely along boundaries. A correct solution will be a partition of the study area and each polygon within that ...


12

In principle, you cannot do this in a unique, accurate way without reconstructing something like the original DEM. Let's see why, by doing the computation with a (difficult but realistic) example. It begins with a small portion of a 30 meter DEM, about 15 by 11 kilometers. Contours have been computed at regular intervals: this is where you begin. To ...


11

At version 10, there is now a Minimum Bounding Geometry (Data Management) geoprocessing tool which: Creates a feature class containing polygons which represent a specified minimum bounding geometry enclosing each input feature or each group of input features. However: The Geometry Type (geometry_type) options CONVEX_HULL, CIRCLE, and ENVELOPE ...


11

You need to iterate at some level. (Update: I've edited to remove all "for" loops, except for one list comprehension) # imports used throughout this example from shapely.geometry import Point from shapely.ops import cascaded_union from itertools import combinations # Here are your input shapes (circles A, B, C) A = Point(3, 6).buffer(4) B = Point(6, ...


9

The criteria for valid polygons are defined in the OGC's Simple Feature standards document* adhered to by the majority of GIS software and spatial databases. The reasons for requiring the start points and end points to match are likely to relate to the topological concept of a closed set. The rules for a valid polygon are: Polygons are topologically ...


8

You have to use lyr.SetFeature(i) to trigger the update in your shape file. You'll have to close the data sources in the end so things get written. import sys import ogr ds = ogr.Open( 'tttttttttt.shp', update = 1 ) if ds is None: print "Open failed./n" sys.exit( 1 ) lyr = ds.GetLayerByName( "tttttttttt" ) lyr.ResetReading() field_defn = ...


7

The geometry_dump data type is a simple composite type with two fields: path[] (a 1-d array holding the position of the geometry within the dumped object), and geom, which is what you want. To access geom, just use (ST_Dump(the_geom)).geom (the extra parentheses are required, and is a bit of a gotcha when accessing members from composite types). For example: ...


6

It also makes many algorithms easier if you don't have to worry about wrapping round to the beginning of the polygon again.


6

There are many algorithms to solve this problem (Wikipedia "Convex_hull_algorithms"): Gift wrapping aka Jarvis march — O(nh): One of the simplest algorithms. It has O(nh) time complexity, where n is the number of points in the set, and h is the number of points in the hull. In the worst case the complexity is O(n2). Graham scan — O(n log n): Slightly more ...


6

Sounds like spatial bookmarks - maybe that's also an option. But given that you have a current polygon layer in the same CRS as the project, you can do this in the python console to add a new feature with the current extent: f = QgsFeature() f.setGeometry( QgsGeometry.fromRect( qgis.utils.iface.mapCanvas().extent() ) ) l = ...


6

Converting lines to polygons will be easy: (Vector > Geometry Tools > Lines to polygons) To deal with dangling ends, you could create a buffer around the polylines (Vector > Geoprocessing Tools > Buffer) and set them to 'dissolve'. This would attach any dangling endpoints to eachother. Then convert the buffer polygons into lines (Vector > ...


6

For dealing with the dangle problem I suggest you try the Polygonizer plug-in, see here. Nick.


6

This looks like it must be a O(n^2) algorithm for n points (although I have been unable to prove this). That means it will scale poorly and you're doomed to long computation times with more than a few thousand points. But some observations will help: Each "direction" is really two directions, that of a ray and another ray in the opposite direction. It ...


6

I think the Integrate tool from the Data Management toolbox should solve this - you can set a tolerance and it will align and remove any slivers from two polygons. ArcGIS Integrate tool help


5

I've used Hawth's Tools "Create Minimum Convex Polygons" under the Animal Movements menu. You can use a feature selection within ArcMap.


5

i think you can do it with some codes. check out here for splitting polygons with Split (Analysis): Splitting the Input Features creates a subset of multiple output feature classes. Syntax Split_analysis (in_features, split_features, split_field, out_workspace, {cluster_tolerance}) Examples: import arcpy arcpy.env.workspace = "c:/data" ...


5

Try gdal_polygonize.py. E.g., to create a Shapefile mylayer.shp from input myraster.tif: gdal_polygonize.py myraster.tif -f "ESRI Shapefile" mylayer.shp or to output directly to a PostGIS database (see the PostgreSQL / PostGIS driver details for GDAL): gdal_polygonize.py myraster.tif -f PostgreSQL PG:"dbname='postgis' user='postgres'" mylayer (ignore ...


5

I was wondering about the same but found that there is no such out-of-the-box tool. I made an add-on for this. You can download it here: http://www.arcgis.com/home/item.html?id=a9b032f739254ebeb6221c9294ebc886


4

1)Convex Hull in GRASS GIS: http://grass.fbk.eu/grass64/manuals/html64_user/v.hull.html 2)Convex Hull in Qgis Vector Tools (very easy to use):


4

goto: http://www.gadm.org/country Select Malaysia and download a) as kmz-files : two files level1 and level2 , level2 unfortunately gave me an error when loading in Google Earth b) as a shapefile. load into qgis and save the different levels as kml files(rightclick in left panel on layer-name and save as) this works well for me in Google Earth


4

It's not really any different than creating a Cartesian grid; the only complication involves representing the circular arcs that bound each cell. As in the Cartesian case, the input should include an origin, a set of radii to use, and a set of angles to use. For greater generality, we needn't require that radii or angles be equally spaced. Here's an ...


4

There is a CadTools Plugin. AFIK it is only suitable tool for this task at the moment.


4

If you have a polyline feature class and needs to convert it to polygons, use the ESRI Feature to polygon tool. Note however, this requires an ArcInfo/Advanced ArcMap license.


4

One technique you could use to remove noise from a binary raster is to use Expand and then Shrink from the Spatial Analyst toolbox. By expanding by n you will fill any holes of less than n * 2 cells wide (holes are filled from every edge), and then the shrink will return your boundaries to (mostly) original values (you'll lose noise around the edge of the ...


4

Instead of using Feature to Polygon multiple times, you could use your SearchCursor to read the vertices of each ellipse and then create a polygon from the vertices. shpin = "Feature class" shpout = "output polygon FC" #Get number of features in input. entries = int(arcpy.GetCount_management(shpin).getOutput(0)) #Get name of OID field. oid = [str(x.name) ...


4

If you have an advanced licence, you can use the "feature to polygon" tool to do this. Otherwise, you need some plug in. For instance, the free version of ET Geowizard can help you.


4

You need to break it down to points if they're good points and reconstruct. Polylines are made from paths, polygons are made from rings. Although they are created in a similar way they are not compatable, hence your error. Go through each point on the line adding a point to your output array and then insert. here's a post that might help Get all the points ...



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