Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a points in the middle of polylines. The data is now in the form of shapefile. Is there an easy way to do this?

share|improve this question
1  
What software do you have available? If you have ArcGIS, you can use the Feature Vertices to Points tool to get the midpoint of a line as stated in this question. You can do this in 10.1 with a trial licence (Advanced). – Cindy Williams-Jayakumar Nov 15 '12 at 8:27

This is a simple way to find the center of lines in QGis: Vector > Analysis > Mean Coordinates

enter image description here

This worked very nice and fast.

Points are created in another shapefile, and the attribute table already comes with the coordinates along with the Unique ID field you selected earlier.

enter image description here

I tried before to convert the lines into polygons, then extracting the polygon centroids, but the new solution is one step shorter.

share|improve this answer

if you have qgis;

  1. use SPIT - Shapefile to PostGIS Import Tool to adding your shapefile as postgis table
  2. run this query:

.

SELECT id, ST_AsText(ST_Centroid(the_geom)) as Cetroids FROM myPolyLines;

or

SELECT id,CENTER(the_geom) as Cetroids FROM myPolyLines;

ST_Centroid — Returns the geometric center of a geometry.

Computes the geometric center of a geometry, or equivalently, the center of mass of the geometry as a POINT. more info

it will return you centroid of your line then you can update or set it as new column or anything.

centroid

share|improve this answer

use feature vertices to point in arcmap : Arctoolbox => data management tools => Features => Feature Vertices to point => select mid point type .

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.