Tag Info

Hot answers tagged

11

Here I have used the Symbol Levels properties to draw the cartographic lines with casing at the bottom and fill at the top. The draw order is base 0, where 0 is the last item to be drawn. See screenshot: You'll also want to check that line caps and joins are set to "round" in the Cartographic Line symbol properties. Do this for both layers, the casing and ...


11

The highest elevation within 10 km is the neighborhood maximum value computed with a circular 10 km radius, so just extract a profile of this neighborhood maximum grid along the trajectory. Example Here is a hillshaded DEM with a trajectory (black line running from bottom to top): This image is approximately 17 by 10 kilometers. I chose a radius of ...


10

Following on from the comments, here's a version that works with perpendicular line segments. Please use with caution as I haven't tested it thoroughly! This method is much more clunky than @whuber's answer - partly because I'm not a very good programmer, and partly because the vector processing is a bit of a faff. I hope it'll at least get you started if ...


9

This can be done quite easy in SQL All the below examples can be tested directly on http://postgisonline.org/map.php. Just paste the query and press Map1 SELECT GENERATE_SERIES(FLOOR(ST_YMin(the_polygon))::int , CEILING(ST_YMax(the_polygon))::int,200) y_value, ST_XMin(the_polygon) x_min, ST_XMax(the_polygon) x_max from (SELECT the_geom AS ...


9

I discovered this page on Esri's site that should allow you to contruct polygons from your lines with only an ArcEditor license. It's unclear from that page whether or not you have to set up a topology first (and whether that topology, if required, can be just a map topology created through the topology toolbar, or a geodatabase-level topology). It looks ...


8

You can pass an array of layers to the select control selectControl = new OpenLayers.Control.SelectFeature( [lineLayer, pointLayer], { clickout: true, toggle: false, multiple: false, hover: false, toggleKey: "ctrlKey", // ctrl key removes from selection multipleKey: "shiftKey" // shift key adds to selection } ); ...


8

With PyQGIS in the Python console, see How to add Direction and Distance to attribute table? for the azimuths of the segments of a line (with the azimuth functions of Points: point1.azimuth(point2)) but you can use many other Python modules like Shapely and Fiona without using QGIS see Python: traitement des couches vectorielles dans une perspective ...


8

You must first understand how PyQGIS handles geometry (Geometry Handling) The most important element is the point: QgsPoint(x,y) and a line or a segment of line are composed of two points: QgsGeometry.fromPolyline([QgsPoint(x1,y1),QgsPoint(x2,y2)])); So to construct a line: line_start = QgsPoint(50,50) line_end = QgsPoint(100,150) line = ...


7

Try Intersect tool in the analyses toolbox if you are on ArcGIS. Set output to point.


7

If you are looking for a solution that does not require developing a .NET tool, you can use the python script below to accomplish exactly what you are after. I had exactly the same need and wrote the following script as the solution. Configure it as an ArcCatalog tool with the 4 parameters, or comment out the parameters and uncomment the hardcoded ...


7

Since you are already symbolizing by road condition (which I'm guessing may be represented by a few colors), I would suggest to not use a multi color dash line to represent survey origin (sometimes less is more). I generally use a buffer/fade effect for displaying multi attribute line info, see caption below.


7

You can use st_intersection Examples 1: test=# select st_astext(st_intersection('LINESTRING ( 0 0, 0 2 )'::geometry, 'LINESTRING ( 0 0, 2 0 )'::geometry)); st_astext ------------ POINT(0 0) (1 fila) Example 2: test=# select st_astext(st_intersection('LINESTRING ( 1 0, 0 2 )'::geometry, 'LINESTRING ( 0 0, 2 0 )'::geometry)); st_astext ...


7

Posted a code snippet(tested in python console) that doest the below Use QgsSpatialIndex to find the nearest line feature to a point Find the nearest point on this line to the point. I used shapely package as a shortcut for this. I found the QGis methods for this as insufficient(or most probably i do not understand them properly) Added rubberbands to the ...


7

You need to use Symbol Levels: The higher the number the later is it drawn. So black will be rendered first then the purple over top meaning that any black bits will be rendered over.


7

The simple way to do this, without writing any Python, would be to translate the start and end to a WKT version of the line: Open the csv in Excel or Open Office, or whatever you use Create a new column with the formula: ="LINESTRING(" & A1 & " " & B1 & "," & C1 & " " & D1 & ")" Replacing A1, etc, with your start and end ...


7

Yes, but sort of. ArcGis no longer has line-node topology that enables the user to tell how many arcs (lines) are connected at their ends (nodes). To check is one thing, but how about to fix instead? If you open the feature class in ArcMap and then use planarize lines (give a tolerance) and the lines will be snapped and split at intersection - saves a lot ...


6

Maybe the answers to this question are helpful: How to simplify a routable network? I used GRASS v.clean in the end.


6

The solution to the first part of your question is "Splitting a line into an equal number of parts": The Split command on the Editor toolbar allows you to split a line into an equal number of new features. For example, you can use this Split option to break a line into pieces that are the same length. This functionality is similar to the Divide ...


6

Try dissolving based off of OBJECTID or FID. Then use Feature To Polygon (Data Management) to convert your polylines to polygons if you wish. To illustrate, here are some sample lines: Attribute table before dissolve by OBJECTID Attribute table after dissolve by OBJECTID


6

You could use line-to-polygon tool (See How can I transform a polygon to a linestring in QGIS?) followed by v.clean command (See http://grass.osgeo.org/grass64/manuals/v.clean.html).


6

Here's a Python function that creates a memory layer containing a line at the specified latitude. You call it using createLatitudeLayer(latitude=-23), for example. You can specify which CRS the layer should use by specifying targetCrsEPSG=<EPSG code>. You can also specify how many points to use for creating the line, by setting numpoints=<number ...


6

Add another layer into your style as "marker line" and draw markers only at line ends. See the screen capture below.


6

You need to change the symbol for your roads to a Cartographic Line symbol rather than a Simple Line symbol. That will give you more control over how it's drawn. When you add a line layer to ArcMap, it defaults to a Simple Line symbol, which has the rounded ends you're seeing. With a Cartographic Line symbol, you can change the line end caps. You will ...


5

The Points2One Plugin might be helpful here. Your data will have to be in the following format: id, order, x, y stream1, 1, x_start, y_start stream1, 2, x_end, y_end stream2, 1, x_start, y_start stream2, 2, x_end, y_end After loading a file like this, you should get four points displayed. In Points2One Plugin, you can chose ...


5

Depending on how far you got in the process, you may want to skip to step six. I have however provided full steps for creating a layer below. The basic process you would want to follow for creating a layer in QGIS is: From the Layer Menu, choose New Shapefile Layer... Specify the type. In your case, for a road you likely will want to specify the type as ...


5

I eventually fixed it by using PostGIS (since this was the eventual target of my fixed polygon layer anyway). Here is the SQL I used: ST_MakePolygon(ST_LineMerge(ST_Collect(ST_SnapToGrid(geom, 0.001)))) It basically rounds the vertex coordinates to remove any gaps in the coastline, then zips all the lines into a single line which is used as the boundary ...


5

One option is to create a fishnet grid specific to your area of interest. By specifying one row and X columns, you can very efficiently create a series of lines. I describe this method in greater detail here and here for two similar situations. For fine control of individual line placement, use the editor. From the image, you can see I created 16 lines ...


5

I had the same problem and tried James S' solution, but couldn't get the GDAL to work with Fiona. Then I discovered the SAGA algorithm "Cross Profiles" in QGIS 2.4, and got exactly the result I wanted and that I presume you are looking for too (see below).


5

The Vector -> Geometry Tools -> Extract Nodes tool will generate a point layer shapefile with points at each vertex of each line.


5

Simply create a text file with this content: id;wkt 1;LINESTRING(-180 -23, 180 -23) and use Layer -> Add delimited Text Menu entry with semicolon as delimiter and EPSG:4326 as CRS. For meridians, it is better to end the line at 89° when using EPSG:3857: id;wkt 1;LINESTRING(7 -89, 7 89)



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