Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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? Cheers, Sanna

share|improve this question
    
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). –  Arabella Nov 15 '12 at 8:27
add comment

2 Answers

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

i hope it helps you...

share|improve this answer
add comment

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

share|improve this answer
add comment

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.