protected function createNewLayer($map, $driver, $layerName, $geoType, $bSearchSpatialRef) { // if layer contains point objects if ($geoType == wkbPoint) { // before creating layer "entities" we create layer "blocks" $layerBlocks = OGR_DS_CreateLayer($driver, 'blocks', NULL, wkbMultiLineString, NULL); // in this layer we export representaion of all point objects (it's a square) $wktLine = 'MULTILINESTRING((-0.5 -0.5, 0.5 -0.5, 0.5 0.5, -0.5 0.5, -0.5 -0.5))'; $geoOGR = ogr_g_createfromwkt($wktLine, NULL, NULL); $dfnLayerBlocks = OGR_L_GetLayerDefn($layerBlocks); $dataLine = OGR_F_Create($dfnLayerBlocks); OGR_F_SetGeometry($dataLine, $geoOGR); for ($i = 0; $i < OGR_FD_GetFieldCount($dfnLayerBlocks); $i++) { $fieldDfn = OGR_FD_GetFieldDefn($dfnLayerBlocks, $i); if (OGR_Fld_GetNameRef($fieldDfn) == 'BlockName') { OGR_F_SetFieldString($dataLine, $i, 'SQUARE'); } } OGR_L_CreateFeature($layerBlocks, $dataLine); OGR_F_Destroy($dataLine); OGR_G_DestroyGeometry($geoOGR); } return parent::createNewLayer($map, $driver, 'entities', $geoType, false); }