Tag Info

New answers tagged

0

I can only suggest a simple method that will give an approximate on average; yet if you are looking for the exact percentage reduction of area this would not work - but might guide your thoughts towards a coding solution. This method is based, like others have suggested, on negative input to the buffer tool. However it also involves adjustment to the the ...


2

Since OGR version 1.10.0 the sqlite SQL dialect has been able to be applied to any spatial datset. Which is great, as it means that you can apply it to your GeoJSON files. Looking at the OGR GeoJSON documentation you can see that the layer name for a GeoJSON file is OGRGeoJSON which means that the SQL that selects from the GeoJSON file will translate from ...


0

INSERT INTO tablename (name, polygon) VALUES ( 'Name', ST_GeomFromGeoJSON ( '{ "type":"Polygon", "coordinates":[ [7.734375,51.835777520452], [3.8671875,48.341646172375], [7.20703125,43.580390855608], [18.6328125,43.834526782237], ...


2

Use a Categorized style on the layer.


2

In QGIS 2.8.1 version, Right click on the layer. Go to Layer Properties. Clcik Styles Tab. Select drop down value Categorized. Use Random colors from Color Ramp drop down list.


4

This method uses the intersect() function from the raster package. The example data I've used aren't ideal (for one thing they're in unprojected coordinates), but I think it gets the idea across. library(sp) library(raster) library(rgdal) library(rgeos) library(maptools) # Example data from raster package p1 <- shapefile(system.file("external/lux.shp", ...


1

If you have the spatial analyst extension you can use the Euclidean Distance tool. 1. Convert the buffer to a raster with the "To Raster" tool (under conversion tools). 2. Then run the Euclidean Distance Tool which will create a raster with values representing distance from the cells that comprised the input raster. 3. Then if necessary, you can extract ...


1

In ArcGIS, you can use tabulate area for this. It will give you a table as output with the number of pixels of each class within each polygon. Then you need to divide each column by a the total count and you have the percent. Note that ArcGIS selects a default raster size for internal analysis. So it is better to specify the pixel size in the environment of ...


1

I think you are looking for the Intersection tool available in QGIS. In the following picture each feature of the blue polygon has a soil attribute and while the red polygon is the polygon of your clip. Using the Intersection tool in QGIS (Vector -> Geoprocessing -> Intersection) or in Processing (open the Processing toolbox and type Intersection) the ...


2

You need to be in an edit session and have the Editor Attributes window open (Editor dropdown > More Editing Windows > Attributes). The simplest solution is: In the Attributes window, right-click the feature you want to copy from and click Copy Attributes. Right-click the feature you want to paste into and click Paste Attributes. This replaces all ...


2

A group aesthetic is missing: ggplot() + geom_polygon(data=fortify(regions), aes(long, lat, group=group)) Otherwise the last point of a polygon is connected with the first point of the next polygon. See also here: SpatialPolygonDataFrame plotting using ggplot Remove connecting lines in ggplot2 geom_polygon


0

Everything looks good up to this point: if (BF_val == "9" && BU_val == "31") { IFeatureCursor f_cur1 = Building.Search(pslt, false); IFeature feature1 = f_cur1.NextFeature(); IRelationalOperator relop = bld_F.Shape as IRelationalOperator; relop.Overlaps(feature1.Shape); if (Building.FeatureCount(pslt) > 0) { ...


0

If you only want one output record, remove the GROUP BY clause: SELECT 1 AS cartodb, ST_Union(the_geom_webmercator) AS the_geom_webmercator FROM counties_ny The output will be a MultiPolygon, probably, since Staten Island and other things cannot be merged due to the water in between.


3

Ubuntu 14.04, QGIS 2.8.1 The way I did this with your test file was to convert the DWG file to a DXF using (free) Teigha File Converter. Then I loaded the DXF into QGIS and tried to polygonize it (using 'Polygonize' from the Processing toolkit). In fact 'Polygonize' only partially converted the lines to polygons, there is a problem with the DXF. So, it was ...


2

For C# NetTopologySuite is a great option. It's one of the children of the JavaTopologySuite, father of GEOS, Shapely, JSTS, ffi-geos... and maybe Thorin too. I haven't tested on a real SQL Server database, but you could use it like this: MsSql2008GeometryReader geometryReader = new MsSql2008GeometryReader(); MsSql2008GeometryWriter geometryWriter = new ...


0

Try this, I used it to label the grid. A1 B1 C1.....A2 B2 C2...etc Remember to make adjustments to the code for the # of rows and columns. In field calculator, select python, then: import string c=-1; r = 0 def code_grid(rows=1,cols=1): c += 1 global c, r UC = list(string.ascii_uppercase) if c >= cols: c = 0 r += 1 label = UC[c]+str(r) ...


1

For the most part, CAD doesn't deal in polygons the same way that GIS software does. You have a couple options. Develop a workflow that converts your CAD drawings into a GIS format and then merges the lines into polygons based on a common attribute or vertices. The Feature to Polygon tool in ArcGIS is commonly used in this process. For example, if the ...


1

Maponics would love to supply you with the best neighborhood boundaries available. If nationwide drops of shape files are too large or beyond your budget, you can also use our API that enables you to download just what you need by attribute, geographic window or ID. In addition, we also have "Context" data that is associated with our neighborhoods, carrier ...


2

I think your trigger function should look something like this: $BODY$ DECLARE lat DOUBLE PRECISION; lon DOUBLE PRECISION; id INTEGER; BEGIN lat := ST_Y(ST_Centroid(NEW.geom)); lon := ST_X(ST_Centroid(NEW.geom)); id := NEW.id_excavation; UPDATE t_excavations SET longitude=lon, latitude=lat WHERE id_excavation=id; RETURN NULL; END; $BODY$ and you'll ...


2

There should be a pretty simple solution to your issue. You can draw a polygon which will not overlap any other polygons in the same layer. This is done by ticking the "Avoid Intersections" tick box in the snapping options (Settings> Snapping Options) In QGIS 2.8 this is done through the "Advanced" mode, in 2,6 it should be the basic snapping options: ...


1

searching for a solution for colour gradient based SLD for polygons I found this: http://docs.geoserver.org/latest/en/user/styling/sld-tipstricks/transformation-func.html - here interesting: "Interpolate" transforms a continuous-valued attribute into another continuous range of values. Geoserver provides already a solution but it is not called something with ...


4

Running the buffer tool will create a second polygon offset the distance you specify from the first. Corners are radiused by default, no need to crop.


1

The topology referred to has nothing to do with custom topology rules that you set up. It applies to all polygons whether any topology rules set up by the user exist or not. The simplification errors that are checked include the creation of new self-intersections and the collapse of parts of the polygon down to lines or points. It is not a bug, since the ...


0

The AOI tool solved the problem while in ArcScene http://resources.arcgis.com/en/help/main/10.1/index.html#//00q800000144000000 Another option is to use SelectLayerByLocation tool paired with CopyFeatures tool. I began coding this into a python toolbox: def execute(self, parameters, messages): """The source code of the tool. """ # Get current ...


2

The general workflow to construct your polygon would be something like this: st_makepolygon(st_linefromMultipoint(st_collect(points.geom))) But you have to be aware that : your linestring has to be closed order of vertices does mater a rudimary sql querry to create a polygon from a set of points would be the following: with line as ( with mp as ( ...


2

I'd change my tables to something like this: CREATE TABLE regions ( id SERIAL PRIMARY KEY, name text NOT NULL, geom geometry(Polygon,4326) ) CREATE TABLE stations ( id SERIAL PRIMARY KEY, region_id INTEGER NOT NULL REFERENCES regions (id) ON DELETE CASCADE, name text NOT NULL, point GEOMETRY(Point, 4326) NOT NULL, CONSTRAINT fk_reg FOREIGN ...


4

In MapInfo, regions include the set of polygons, rectangles, and ellipses. Don't ask why they consider rectangles to be a special type of polygon, I'll never figure that out. However, I think you've misread the tool. It actually says "Convert to Polylines." See this post for more information about MapInfo Map Object Types.


0

I was trying to figure out the same thing and made this model builder. I am not good with scripting at all and new to model building but this was pretty easy to make and worth the effort. Open model builder and select INSERT>Iterators>feature selection. Use the input to be your polygon shapefile that contains the 30 different polygons, hopefully they ...


0

Im not sure how familiar you are with GIS but within QGIS there is a buffer tool. The problem you'll face with most of these tools is that they buffer around the whole polygon and not just the northern/southern edges I hope that helps. Rowan


0

There may be faster ways, but my method of achieving this goal is to make use of a cursor to test each feature through selection. In the code below, a feature layer is created of your input feature class. Then each feature is selected by OID through an SQL where clause. A select by location is then performed on the same layer (I use ...


1

Yes. In Layer properties, you can use Labels -> Placement -> Using perimeter. You can choose Position as 'Below line' and adjust the Distance to achieve something like below.


2

I suppose that what you want to do is to create a polygon grid and select all grid cells which intersects the polygon geometry. If I am right, please reformat your question because it does not make sense as is stands now. By definition a geometry has exactly one bounding box or minimum bounding rectangle as it is also called.


0

Most spatial software will allow you to find a bounding box. Using max/min coordinates in lon/lat directions will also make it easy to establish corner coordinates for a bounding box. You will find the answer to this particular challenge using python in QGIS here. As for splitting it you could use any set of polygons. You could create a fishnet of your ...


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 ...


2

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 ...


3

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 ...



Top 50 recent answers are included