Tag Info

New answers tagged

0

try the tool Split Polygons With Lines. At first you have to create a polygon which covers the whole area. Then use the tool. After using the tool you can easily delete the parts which doesn't matter to you.


1

For part one use ST_MaxDistance Returns the 2-dimensional maximum distance between two linestrings in projected units. If g1 and g2 is the same geometry the function will return the distance between the two vertices most far from each other in that geometry. Example: SELECT gid, ST_MaxDistance(geom, geom) AS "Max Length" FROM layer


2

For the first part of your question: What about ST_LongestLine using the same geometry twice as input? SELECT ST_Length(ST_LongestLine( (SELECT geom FROM mylayer WHERE gid=1), (SELECT geom FROM mylayer WHERE gid=1)) ); For the second part of your question: Concerning the calculation of the average width of polygons some interesting answeres can ...


0

thanks @Luke, @Neil, and @Chris; Esri support ran my map through MXD doctor to repair it. I had been using joins and relates -> join from within the polygon layer, selecting zip code as the link field, then my point layer, again linking by zip code. after the tech ran MXD doctor it worked ; then we right clicked the layer ->data ->export data as feature ...


1

This topic has come up here: Create Shapefile with auto increment primary key in QGIS My suggestions would be: 1) SQLITE / SpatialLite databases support auto-incrementing on a field set to INTEGER PRIMARY KEY: On an INSERT, if the ROWID or INTEGER PRIMARY KEY column is not explicitly given a value, then it will be filled automatically with an ...


1

The easiest way to do this would be probably with a python script or maybe it's possible with the field calculator. Sorry I don't have one for you, maybe someone else will. In the meantime, I'd search for a python script for it. I've seen a lot about this for ArcGIS, but I'm sure there's something out there for QGIS.


5

I can crush this down to 3 lines of code, no cursors required! import arcpy arcpy.SpatialJoin_analysis("Site", "points","in_memory/points_SpatialJoin", "JOIN_ONE_TO_MANY", "KEEP_ALL", "", "INTERSECT") arcpy.Statistics_analysis("points_SpatialJoin", "in_memory/stats", "Join_Count SUM","Id") Then simply sort the table to find the polygon with most points.


1

Another option would be to use the Minimum Bounding Geometry (Data Management) tool. Creates a feature class containing polygons which represent a specified minimum bounding geometry enclosing each input feature or each group of input features.


5

The following approach uses a Search Cursor and Python dictionary to perform the following workflow: Select points within each polygon feature Update dictionary with key (OID) and value (point count) for each iteration Find max point value and corresponding OID and write to a text file import arcpy, os points = r'C:\temp\mytest\points.shp' polys = ...


0

Here's something I put together from the link you posted and another link that you will see commented out in the code. When you click on the map it will draw a square 10x10 map units from where you clicked. I work in metres so this draws a reasonably sized graphic. Create an add-in with a tool and add this to the class. protected override void ...


1

With the latest GDAL dev build from GisInternals you can now transform dxf into shape and closed lines into polygons in one step: ogr2ogr -nlt polygon testpoly.shp test.dxf ogrinfo testpoly.shp INFO: Open of `testpoly.shp' using driver `ESRI Shapefile' successful. 1: testpoly (Polygon) This will find its way into GDAL 2.0, not 1.11.2 which is coming ...


1

You should send a small example of such DXF file. It looks like DXF driver really does not behave as documented. I made a simple test by digitizing a closing triangle with four coordinates as a polygon and as a linestring POLYGON (( 616 442, 804 551, 764 387, 616 442 )) LINESTRING ( 616 442, 804 551, 764 387, 616 442 ) I made a roundtrip by saving ...


2

The problem is that something in the stack (QGIS, GDAL, or the operating system) doesn't appear to be handling the ã character in the directory name (so Portimão becomes Portimo). That looks like a bug, which you should check isn't already filed at http://hub.qgis.org/projects/quantum-gis/issues, and if not already filed, add details. In the mean time, I'd ...


0

Intersect 2 layers Add field [Times] and calculate it using 2ndNumeric*ShapeArea Summarise field [Times] and [ShapeArea] using first layer UniquPolygonId Divide [Sum_Times] by [Sum_Area], this will give you weighted second layer numeric Transfer result to 1st polygon table and check the correlation between 2 columns, i.e. 1st numeric and weighted one


2

For PostGIS 2.1, you can just convert the geometry to a geography type, where longitudes are always normalised to the -180/+180 range. For example, take these coordinates that are outside the range, and compare the normalised output: SELECT ST_AsText(geom::geography::geometry) FROM (SELECT 'POLYGON((180.12 -16.69,180.00 -16.80,179.89 -16.95, ...


2

You use this tool to cut out a piece of one feature class using one or more of the features in another feature class as a cookie cutter. This is particularly useful for creating a new feature class—also referred to as study area or area of interest (AOI)—that contains a geographic subset of the features in another, larger feature class. Click on the ...


2

You can use ST_DumpPoints and iterate over its results. It should be exactly what you're looking for.


0

Why don't you just save the edits to your wfs-t? If you don't have to use Mapserver you could for example use Geoserver to publish your services and save your edits and users could download the layer directly from Geoserver as shapefiles. ...


0

OpenLayers runs in the browser, and does not provide a method for generating shapefiles. What I would suggest is generating GeoJSON of your drawn featurres and POSTing that to the server, where you can use your language of choice to generate a shapefile from the GeoJSON.


0

Have you check this out ? http://www.diva-gis.org/gdata if this is what you were looking for ?


0

Unfortunately, there isn't a freely available, nation-wide polygon layer. You can try contacting MAPI regarding their Cadastral data which might have neighborhoods, or the CBS/MoI statistical region layer. (If you don't know what these are, search for them on govmap) Other than that, your only option is a point layer with neighborhood names as found in Open ...


0

I found that by increasing the maxmemory and chunksize that I got modest speed increases. I had to do this conservatively, because the processing sometimes can take up 3-5 times as much memory as the maxmemory setting (it must be writing multiple files at that max memory setting). Here's the code for changing those memory settings: ...


1

If you want to get the distance between two sets of lat/lon, 4326, points, then you can use ST_Distance_Sphere or for more accuracy, ST_Distance_Spheroid. If your fence table is in 900913, then use, ST_Transform to convert, so that both sets of points are in a common SRID. SELECT ST_Distance_Sphere( (select ST_Transform("Fence", 4326) FROM ...


2

The $x and $y values only work for point layers. Create a layer for polygon centroids and then that will give the x and y values using the $x and $y commands.


0

Arcobjects: IPolygon polygon = (IPolygon)geometry; IPointCollection pointCollection = (IPointCollection)polygon;


0

In QGIS to convert a polygon into a point you would use the Polygon Centroids tool. This is found under Vector>Geometry Tools>Polygon Centroids... This will also preserve attributes and puts the point in the geometric centroid of the polygon. Edit: For points around the perimeter, you will want, as mentioned, Vector>Geometry Tools>Extract Nodes... This ...


0

again, I found the answer somewhere else: http://lists.osgeo.org/pipermail/grass-user/2010-October/058381.html "The base map should be integer (category ) values, where the mode is calculated for all cells with the same cat value, so it indeed should be an integer raster." I need to transform my float values into integers, but before I need to multiply ...


3

You can do this with the Intersect tool. Normally, performing an intersect with polygons will only return the overlapping area. But if you change the output_type from INPUT to LINE, then you can get just the collinear borders between polygons. If this is our input: And we change the output_type parameter: We get the green lines as output: The ...


1

You can do this with python if you are at least at ArcGIS 10.1. If you have ArcInfo, you can use the Feature to Line tool. Otherwise, you can use this simple script. This script does not support true curves though. The resulting lines, if topologically correct should overlap then you can run an intersect of this line fc on itself to find the boundaries ...


0

I got what I need and I want to sum up two possible solutions: First one was the link posted by @Vince in the upper comments: How to convert geometry to WKT using ArcPy? It uses Python in connection with arcpy. Thx for the find Vince. Another solution, using python only is script called shapefile.py. It can be found here: https://code.google.com/p/pyshp/ A ...


0

Esri_MapClick_Handler = dojo.connect(map, 'onClick', addToMap) function addToMap(evt) { var x = evt.mapPoint.getLatitude(); var y = evt.mapPoint.getLongitude(); var latlog = new esri.geometry.Point(x, y); MassPoints.push(latlog); } function activateTool() { toolbar.activate(esri.toolbars.Draw.POLYGON); //geometry.rings ...


1

Seems to be easy, you just need to create the XY coordinate field in your polygone table and later in the script use the arcpy.da.SearchCursor(Poligone.shp,"FieldXY")in something similar to this. Hope this works for you ^^ with arcpy.da.SearchCursor("Poligone.shp",'Field') as Buscador: with open(nombarch2,"a+")as c: for row in Buscador: ...


2

Based on your CSV, Tablename: Wahlkreise Column containing value to union on: wahlkreis Other Columns use an aggregate function to grab one of the values (all of them are the same for each district / wahlkreis In the SQL window in CartoDB, type: SELECT wahlkreis , cartodb_id , max(strong_party) as strong_party , max(einwohner) as einwohner ...


1

I figured this out, you need to refer to an image file, here I have referred to a png I uploaded to cartodb: cartocss: "#layer_name[field='field_value'] {polygon-pattern-file: url(website/image.png); line-color: #9e1e62; line-width:1;} replace the png with the appropriate image replace layer_name with the appropriate layer replace field with the field ...


1

You can do a spatial intersection between your two datasets ("Al", "output") with the following code: library(rgeos) inter = gIntersection(Al, output, byid=T, drop_not_poly=T)


2

Update: The solution to that particular problem, which got revealed bit by bit, was, that the Memory Layer Saver plug-in had to be installed to make the mask layer, which hides the labels, persistent and gets saved with the project. For those who do not need to use the Mask plug-in but still want to hide particular labels or give them different appearance, ...


0

You could try using the r.mask tool from GRASS. This creates a mask layer which can be used to limit certain operations such as labels. You can read more information about it here where it also provides a couple of examples: Creating a mask showing elevations (such as a lake) How to remove masks Creating a mask specifically for the North Carolina ...


2

There are a couple of different ways you can do this, and it will vary depending on the software you are using. But in QGIS you can use the Vector Grid tool, which is found in Vector - Research Tools. The tool allows you to set the extent of your working area based on a layer (in your case the polygon layer) and then output either a line or polygon grid ...


1

The behaviour of gIntersection is not to pass any intersected data by design: Since there are no general matches between intersected spatial objects, any arbitrary operations on attributes require assumptions about unknown user intentions. This is why no data slots should be passed through ... ... The design of gIntesection() is inentional, ...


0

It looks like your coordinates are longitude and latitude, yes? Use Shapely's shapely.ops.transform function to transform the polygon to projected equal area coordinates and then take the area. python geom_aea = transform( partial( pyproj.transform, pyproj.Proj(init='EPSG:4326'), pyproj.Proj( proj='aea', lat1=geom.bounds[1], ...


1

I think you have two issues here. The first may be misleading. The warning that you're getting when you start editing is only that--a warning. It means that one or more of the data layers are in a different coordinate reference system than the map's. You can check what's going on by opening the data frame's property page (one method is to right-click ...



Top 50 recent answers are included