Commit 3f39eec61227370913a7e7b9b37e2b4f654666b1
1 parent
2347fea5
Exists in
master
and in
7 other branches
#258
Showing
6 changed files
with
13 additions
and
1 deletions
Show diff stats
classesphp/classe_shp.php
... | ... | @@ -410,12 +410,24 @@ $para - linha|poligono |
410 | 410 | $reg = array(); |
411 | 411 | $novoshpf = ms_newShapefileObj($nomeshp.".shp", $tipol); |
412 | 412 | $this->layer->open(); |
413 | - $this->layer->whichShapes($this->mapa->extent); | |
413 | + | |
414 | + $prjMapa = $this->mapa->getProjection(); | |
415 | + $prjTema = $this->layer->getProjection(); | |
416 | + $ret = $this->mapa->extent; | |
417 | + if (($prjTema != "") && ($prjMapa != $prjTema)) | |
418 | + { | |
419 | + $projOutObj = ms_newprojectionobj($prjTema); | |
420 | + $projInObj = ms_newprojectionobj($prjMapa); | |
421 | + $ret->project($projInObj, $projOutObj); | |
422 | + } | |
423 | + $this->layer->whichShapes($ret); | |
414 | 424 | $linha = ms_newLineObj(); |
415 | 425 | while ($shape = $this->layer->nextShape()) |
416 | 426 | { |
417 | 427 | $lin = $shape->line(0); |
418 | 428 | $pt = $lin->point(0); |
429 | + if (($prjTema != "") && ($prjMapa != $prjTema)) | |
430 | + {$pt->project($projInObj, $projOutObj); | |
419 | 431 | $linha->add($pt); |
420 | 432 | } |
421 | 433 | if ($para == "poligono") | ... | ... |
915 Bytes
1010 Bytes
687 Bytes
746 Bytes
1.04 KB