Tag Info

New answers tagged

0

The "segments to approximate" option is what you are looking for. So the number you put into that filed will be the number of sides/quarter. So the default is 5, so you end up with a 20 sided polygon. Put in 25, and you end up with a 100 sided on, so it becomes smoother.


0

You can control the resulting number of segments in the Buffer dialog box. And, if you want more, search for "buffer" in the Processing Toolbox: You can use all of these algorithms (from Ftools, GRASS GIS or SAGA)


2

You might like to have a look at this document, which shows an example of using the Polygonizer to make a geological map. http://confound.me.uk/maps/ppv4.pdf‎ After some recent problems, in my version of QGIS (2.3.0-Master, from Ubuntugis) the Polygonizer is now working again. Search for 'Polygonize' in the Processing Toolbox. N.


1

You can snap a line to itself, but only after saving. My workaround is to digitize the line, but set the last point a bit offset to the first point, then save, and then move the last point to the first. As a consequnce, I start digitizing a new closed line with a point that is already created by another adjacent polygon if possible.


2

you can use raster calculator to set your 0 values to NoData. Con(condition, value if true, value if false) will set the false value to Nodata if it is left blank. in your case, you could use Con(raster== 1, 1) a more generic code would be Con(raster!=0, raster) when you convert to polygon, NoData pixels will be ignored. Note that you can make ...


3

Try polygon.buffer(10, join_style=1).buffer(-10.0, join_style=1) A dilation, rounded (join_style=1), followed by an erosion, rounded. There's a diagram of a similar procedure at http://toblerity.org/shapely/manual.html#object.buffer.


4

for rounding your convex angles, you can apply successively a negative then a positive buffer of the same radius. For the angles shown on your figure, you are thus applying the method on the blue polygons. the buffer tool in shapely is part of the shapely.geometry package


0

One solution would be to use the tool Select Layer by Location (Data Management). With nothing selected, run that tool from the Search or Catalog tab. Set the Input Feature Layer to your polygon layer and choose completely_within as your Relationship. This should select all of the donut holes. With those selected, run the tool again, still choosing your ...


1

If your ultimate aim is to remove all of the islands and if the island polygons have the same attributes and assuming you are using ArcGIS then you can use the Dissolve tool and bypass the need to select them: QGIS has a tool also called dissolve which will also allow you to select and attribute field to base the dissolve on:


0

I find that it sometimes gets confused if there are too many nodes on shared lines between features. Chack the geometry validity of the features too because geometry errors can cause problems. Also you could try adding features one by one and not trying to merge all of them together at the same time, if it isnt too time consuming


0

Merge tool will merge other polygon to selected polygon. So if want to merge all other polygon to single polygon then select and merge.


0

I was experiencing very similar difficulties, and tried repairing geometry with all files to no avail. What eventually worked was placing both files into their own file geodatabase, and then running the operation.


1

The closest thing we have in Python to a standard built-in Polygon is defined in "A Python Protocol for Geospatial Data": https://gist.github.com/sgillies/2217756. The most straightforward way to get a Python polygon is to do this: # you have a list of points listPoint = [[13.415449261665342, 52.502674590782519],[13.416039347648621, ...


2

Vince's comments led me to look again at Shapely in Python, and it can do it. In short, the method I used was: get the bounding box of the page/object you want calculate the diagonal of this box, as this will be the minimum length your hatch lines need to be draw a square array of horizontal lines centred on the bounding box's centre, each spaced suitably ...


2

You may instead want to produce a Concave Hull (that is, replace ST_ConvexHull with ST_ConcaveHull as well as possibly experimenting with tweaking the second and third optional target_percent and allow_holes parameters). It may still be disappointingly simple depending on the target_percent you set, but it will most likely be closer to the ideal shape you ...


0

In ModelBuilder, you use Iterate Feature Classes to loop through the shapefiles, then use Collect Values to send the iterator values to Merge. It will look like this:


7

It would be easier with arcpy. for i in range(10000): pol_list = [] for j in range(30): pol_list.append("a" + str(i*30 + j + 1) + ".shp") arcpy.Merge_management(pol_list, "b" + str(i+1) + ".shp") EDIT: for a feature class inside a geodatabase, you don't need the + ".shp" anymore, and you can define the workspace using : ...


3

The following explains (1.) how to construct technically a polygon from points and (2.) different methods to construct a polygon from points. 1. Tool to create a polygon from point coordinates I would use the GDAL Python bindings to do that. To give you a starting point have a look at the following script: from osgeo import ogr # you have a list of ...


2

Join points and ploygons by location and continue your analysis with the join result. The join will append point attributes to the polygons inside which the points are located. Polygons which do not contain any points will have NULL values.


0

If you're comfortable with GDAL/OGR (or willing to level up), you can use ogr2ogr along with OGR SQL to quickly and easily export a single feature from any of the OGR supported vector formats into a stand-alone shapefile. For example.. ogr2ogr -f "ESRI Shapefile" "C:/xGIS/Vector/test/Richland.shp" "C:/xGIS/Vector/COUNTIES_SC_WGS84.shp" -nlt GEOMETRY -sql ...


1

The most common spatial file format is a shapefile, which your data is most likely in. The shapefile is actually a composite of 3 mandatory files and (commonly) several ancillary files. .shp includes the feature geometry .shx an index file allowing for speedy referencing .dbf the feature attributes Ancillary (often generated on-the-fly by GIS software) ...


1

you can do it using this SQL code SELECT row_to_json(fc) FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features FROM (SELECT 'Feature' As type, ST_AsGeoJSON(lg.geom)::json As geometry, ( select row_to_json(t) from (select FIELD_1, FIELD_2, FIELD_N) t ) As properties FROM MY_TABLE_OR_VIEW As lg ) ...


1

255 is the default NoData value in QGIS. I am not sure, what exactly the problem is with the way you tried it, but you could use the GDAL Python bindings to do what you want. For instance the following script converts your shp to a polygon based on the attribute NAME_2_NUM. Import the libraries import ogr, gdal, osr Open your shapefile source_ds = ...


3

You could drape your geological polygons on the elevation surface you created to make them 3D. Two ways in 3D Analyst are Interpolate Shape and Add Surface Information. For an explanation of both see: http://resources.arcgis.com/en/help/main/10.1/index.html#//00q80000005m000000


5

Unless I'm misunderstanding the question, the shape's .extent property is all you need. with open('out.txt', 'wb') as out_text_file, arcpy.da.SearchCursor('path_to_data', ('msa', 'SHAPE@')) as cur: print >>out_text_file, "msa min_lon max_lon min_lat max_lat" for row in cur: msa, ext = row[0], row[1].extent print ...


0

I have no problem with the speed of the calculation with the function rasterize: library(raster) ## Set up a raster #Extent ext <- extent(munisCrop.shape) #Resolution xy <- abs(apply(as.matrix(bbox(ext)), 1, diff)) r <- raster(ext, ncol=xy[1]/0.1, nrow=xy[2]/0.1) ## Rasterize the shapefile #you need to define the the value(s) to be transferred ...


2

You can use functions from the rgeos package to extract such regions (e.g. gIntersection, gDifference). I use gDifference in this example, because gIntersection returns a SpatialCollections object here: # define rectangular region y_lim <- c(-1, 1)*23.5 rect_lim <- cbind(c(rep(bbox(ao)["x", ], each=2), bbox(ao)["x", 1]), c(y_lim, ...


0

After making a topology, check out the Align Edge tool. Click on whichever edge you want moved, and then the edge where you want it to go. With multiple polygons, stretch the boundary of one, by a single vertex, to the edge you want to align to, and use the same tool. Repeat for the rest of them. Whoops, didn't notice this was PostGIS, disregard.


0

You can use ArcGiS and create topology in your geodatabase. You should to choose one of these rules for polygons (for your shapefiles 1 and 3). Than you will be able to validate topologies and fix all of errors.


1

You can create borders by using Polygon to Line tool for each polygon. Then use Near tool on these two borders.


0

Is it feasible to just manually edit the vertices and remove the self intersections? I do this a lot (using QGIS because it seems to be less picky about this issue). QGIS also has a 'Check Geometry' tool that will show you where all the self intersections are. I know you said you're running arc but this might be a helpful approach if nothing else is ...


5

Here's some R code that does the job, the caveat being we are in cartesian coordinates. The input matrix coords is a 5x2 matrix of x,y columns, with the last point being coincident with the first point. This is what you get out of spatial objects in R when you read a shapefile, for example. thinrect <- function(coords, factor=1/3){ dx = ...


3

The solution of @Josh is good. If you are interested only in few polygons this approach perhaps is more quickly: Select polygons you are interested in with your mouse (in map) Right click on polygon layer in TOC. Chose Selection > Create Layer From Selected Features


4

If, in the shape file, there is an attribute that you are interested in, or can otherwise search on, use Version 2 (it's safer), otherwise use Version 1.: Version 1: Open the Attribute Table for the shape file. Add a new Field (under Table Options). Name it "Interested" or something. Short Integer is fine. Go into Editing mode and make sure to select ...


4

You could create a new attribute called "dissolve", and calculate it to be whatever unique value you wish to use for the dissolve. Eg, "for some specific countries" you would calculate dissolve to be "Country + State", while for the other countries you would calculate dissolve to be simply "Country".


1

I created an ArcGIS Create Custom Grid tool that could be useful for this. However, it might have trouble if any of the rectangles are oriented like a diamond shape. You would set the vertical division to 3 and leave the horizontal to 0. After the tool is ran you need to use the Split Polygons tool in the Advanced Editing toolbar. If you use it, let me ...


3

This can be solved with a model but there are 4 caveats: You need an Advance (ArcInfo) license This model assumes your rectangle is a rectangle so the 2 vertical sides are longer Your rectangle is constructed from 4 vertices only If you want to automate this then all your rectangles must have the same dimensions So after running this model you you are ...


0

It is a simple SQL statement, SELECT * FROM table_name WHERE ST_Intersects(the_geom, your_line_string) Replace your_line_string with whatever way you want to supply the geometry. Two nice ways are either as WKT or as a GeoJSON text string. First WKT SELECT * FROM table_name WHERE ST_Intersects( the_geom, ST_GeomFromText('LINESTRING(-160 ...


0

You can convert from multipolygon to polygon with processing algorithm "Convert geometry type". In QGIS menu = Processing->Toolbox. In Toolbox = QGIS geoalgorithms->Vector geometry tools->Convert geometry type


0

You will get the same error if you have not selected the feature in the GUI and then select the layer but hit use only selected features. Also you can try using "vector"->"geometry tools"-> "Multiparts to single parts" This might be installed by fTools, both my installations mac and windows included this tools. The last merge I did I used the dissolve ...


2

For this kind of conversion, you need to choose the attribute field that you want to store in the grid, because a grid can only have one thematic information. This is the value field that you need to define. Knowing that, you can use one of the "Feature to Raster" tools for the conversion, or in your case maybe Polygon to raster which is more specific (but ...


2

You should use the Polygon to raster function (which requires Spatial analyst extension). In the Value field property you assign which field should be the base of your grid, e.g. which different values your grid will have. Don't worry about Cell assignment type and Priority field, play with them if you don't get the desired result. Depending on how ...



Top 50 recent answers are included