MapWindow Home
Search MapWindow.org


  • Home
    • Download
    • Why MW
    • FAQ
    • Contact
  • Products
    • MapWindow
    • ActiveX
    • Plug-ins
  • Software Dev
    • Sample Code
    • Scripts
    • Source
    • Bugs
    • Support
    • Languages
  • Site Tools
    • Forums
    • Tutorials
    • Mailing Lists
    • Team
    • Site Stats
    • Links
  • Get Stuff
    • Buy a CD
    • Buy a T-Shirt
    • MW Book
    • ActiveX Book
    • Donate
    • Buy Support
  • Documentation
    • MWGIS App. User Guide
    • GISTools User Guide
    • MW Plug-ins Dev. Guide
    • MWGIS ActiveX Dev. Guide
    • MWGeoProc Dev. Guide

MapWinGIS:Shape Serialize Format

From MapWindow GIS

Jump to: navigation, search

The Shape object may be saved and loaded to and from a string in a particular format. The format is constructed by appending the following items:

Shape Identifier -- Part Point Indexes -- Points

The shape identifier is followed by a semicolon. Each point index is also followed by a semicolon. Point values will each be followed by a pipe character, |. Points will come in pairs of two, three or four values, according to the following conditions:

 If the shape is a 3D shape (MultiPointZ, PolygonZ, or PolylineZ), then there will be  
 three point values: X (followed by a pipe character), Y (followed by a pipe character)   
 and Z (followed by a pipe character).

If the shape is a MultiPointM, PolygonM, or PolylineM shape, there will be four point values: X (followed by a pipe character), Y (followed by a pipe character), Z (followed by a pipe character) and M (followed by a pipe character).

The record will always end with a terminating pipe character.

An example polyline shape:

 3;0;-112.322|41.322|-113.56|40.735|

In this case, the initial 3 represents a polyline shapefile type. The zero represents a part which begins at shape index zero. Two points are specified: (-112.322, 41.322) and (-113.56, 40.735).

An example PolylineM shape:

 23;0;-112.322|41.322|10|233|-113.56|40.735|15|234|

In this case, the initial 23 represents a polyline shapefile type. The zero represents a part which begins at shape index zero. Two points are specified: (-112.322, 41.322, 10) at M value 233, and (-113.56, 40.735, 15) at M value 234.

The following are the values which represent shape types:

 0 = (Uninitialized)
 1 = SHP_POINT
 3 = SHP_POLYLINE
 5 = SHP_POLYGON
 8 = SHP_MULTIPOINT
 11 = SHP_POINTZ
 13 = SHP_POLYLINEZ
 15 = SHP_POLYGONZ
 18 = SHP_MULTIPOINTZ
 21 = SHP_POINTM
 23 = SHP_POLYLINEM
 25 = SHP_POLYGONM
 28 = SHP_MULTIPOINTM
 31 = SHP_MULTIPATCH
Retrieved from "http://www.mapwindow.org/wiki/index.php/MapWinGIS:Shape_Serialize_Format"
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in / create account
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link

Geospatial Software Lab

Copyright © 2008 - MapWindow Open Source Team
( last updated: December 03 2008.)
Home | Donate | Download | MapWindow GIS Desktop | MapWinGIS.ocx | Plug-ins | Contact | Lists | Bugs | Sample Code | Documentation
Code Repository | Open Source License | Discussion Forum | Wiki | Join the Team | Site Statistics | Links