[MS4W-Users] PHP and OGR_G_CreateFromWkt

Brent Fraser bfraser at geoanalytic.com
Thu Mar 11 12:23:05 EST 2010


I can't seem to get OGR_G_CreateFromWkt to work in PHP.  The code below gives an 
OGRError value of 6 (OGRERR_FAILURE).


<?php
if (extension_loaded("ogr")) {
	$geometryValue = "LINESTRING(0 0, 0 10)";
	$ogrError = OGR_G_CreateFromWkt( $geometryValue, NULL, $hGeometry );
	if($hGeometry == NULL)  {
		print "Unable to create geometry. OGRErr=".$ogrError.", 
WKT='".$geometryValue."'\n";
		if ($hDS) OGR_DS_Destroy($hDS);
		die;
	}
}
?>

Has anybody used OGR_G_CreateFromWkt in PHP?

Thanks!
Brent Fraser



More information about the MS4W-Users mailing list