[mapserver-users] line shapefiles

Kralidis,Tom [Ontario] Tom.Kralidis at ec.gc.ca
Mon Feb 9 11:18:18 EST 2009


 

> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of 
> Donald F Caldwell
> Sent: Monday, 09 February 2009 10:42
> To: mapserver-users at lists.osgeo.org
> Subject: [mapserver-users] line shapefiles
> 
> 
> i am having trouble showing line data on mapserver
> 
> ##############################################################
> #############
> # i create an 'arc' shapefile with one edge
> ##############################################################
> #############
> 
> shpcreate nysf arc
> shpadd nysf -73.905235290527344 40.707859039306641 + 
> -122.380088806152344 37.795818328857422

Looks like you're adding points here for two records

> dbfcreate nysf -s ecity 32 -s wcity 32
> dbfadd nysf "New York" "San Francisco"
> 

This adds one record to the dbf, not two.

> # result - no line
> # my question is - do these tools support lines?
> # if so, how do i make them visible?

$ shpcreate foo arc
$ shpadd foo -75 45 -76 46
$ dbfcreate foo
$ dfcreate foo -s id 32 -s desc 32
$ dbfadd foo "line 1" "mydesc"
$ shpadd foo -80 33 -81 34
$ dbfadd foo "line 2" "mydesc2"
$ ogrinfo -al foo.shp
INFO: Open of `foo.shp'
      using driver `ESRI Shapefile' successful.

Layer name: foo
Geometry: Line String
Feature Count: 2
Extent: (-81.000000, 33.000000) - (-75.000000, 46.000000)
Layer SRS WKT:
(unknown)
id: String (32.0)
desc: String (32.0)
OGRFeature(foo):0
  id (String) = line 1
  desc (String) = mydesc
  LINESTRING (-75 45,-76 46)

OGRFeature(foo):1
  id (String) = line 2
  desc (String) = mydesc2
  LINESTRING (-80 33,-81 34)

You might want to check out the docs at
http://shapelib.maptools.org/shapelib-tools.html 

Hope this helps.

..Tom


More information about the mapserver-users mailing list