[mapserver-users] convert
E Perik
erwin at perik.nu
Fri Apr 5 08:53:37 PST 2002
Hi Topan,
Assuming DTM is digital terrain model points in lat/lon/altitude type,
.....
You could convert this using PHP + Mapscript like following:
if ($init==1) {
// recreate the site layer
$shpFname = "C:\\Program Files\\Apache\\htdocs\\mich\\data\\shptest";
$shpFile = ms_newShapeFileObj($shpFname, MS_SHP_POINT);
$def = array(array("PROG_ID", "N", 5, 0));
$dbfFile = dbase_create($shpFname . ".dbf", $def);
createPoint( 14, 34, 111);
createPoint( 33, 14, 222);
createPoint( 10, 20, 333);
// done... cleanup
$shpFile->free();
dbase_close($dbfFile);
}
function createPoint($x, $y, $name){
GLOBAL $shpFile, $dbfFile;
// Create shape
$oShp = ms_newShapeObj(MS_SHP_POINT);
$oLine = ms_newLineObj();
$oLine->addXY($x, $y);
$oShp->add( $oLine );
$shpFile->addShape($oShp);
// Write attribute record
dbase_add_record($dbfFile, array($name));
}
Createpoint adds point to shapefile and 'info' to dbf-file. You would do
this for every point of your DTM file and that's it, shapefile is
created.
Code is from list, and there are more examples like this one, so a
search could come up with a better example.
Erwin
-----Original Message-----
From: owner-mapserver-users at lists.gis.umn.edu
[mailto:owner-mapserver-users at lists.gis.umn.edu] On Behalf Of Topan
Sent: Friday, April 05, 2002 1:18 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [mapserver-users] convert
Can i convert DTM (planet) data into shape file. if it can, where i can
find
the converter ?
ths
More information about the MapServer-users
mailing list