map EXTENT

Jacob Blankenship jhblankenship at YAHOO.COM
Wed Aug 25 17:08:39 EDT 2004


Thank you for pointing out ogrinfo.exe. I have a
polygon shp file, for which ogrinfo is reporting the
EXTENT as {-106.645 25.837 -93.508 36.500 }. When I
add these to my map file and display the image, the
map is off center and very small. Below are my map and
html files.

Thank you in advance,
Jacob

** Map file
MAP
    NAME TEXAS
    STATUS ON
    SIZE 400 300
    IMAGETYPE GIF
    IMAGECOLOR 240 240 240
    SHAPEPATH "C:\Inetpub\wwwroot\ShapeFiles\TX\"
    UNITS METERS

EXTENT -106 25 -93 36

    WEB
        IMAGEPATH "C:\Inetpub\wwwroot\Images\Tmp\"
        IMAGEURL "C:\Inetpub\wwwroot\Images\Tmp\"
    END

        LAYER
                NAME "TX counties"
                TYPE POLYGON
                STATUS ON
                DATA "cty00"

                CLASS
                        NAME "TX counties"
                        OUTLINECOLOR 60 60 60
                        COLOR 255 255 0
                        SYMBOL 0
                END
        END

END

** HTML file
<?php
dl("php_mapscript_42.dll");

$map_file="./texas.map";
$map = ms_newMapObj($map_file);

$image=$map->draw();
$image_url=$image->saveWebImage();

?>
 <HTML>
 <HEAD>
 <TITLE>US state boundaries</TITLE>
 </HEAD>
 <BODY>
        $nMinX = <?php echo ( $map->extent->minx ); ?><br>
        $nMinY = <?php echo ( $map->extent->miny ); ?><br>
        $nMaxX = <?php echo ( $map->extent->maxx ); ?><br>
        $nMaxY = <?php echo ( $map->extent->maxy ); ?><br>
        <img src="<?php echo $image_url?>">
 </BODY>
</html>



--- Brant Anderson <brant at MUDLABS.COM> wrote:

> Hi Oliver,
>
> There is a tool called 'ogrinfo' included with the
> GDAL package. It is
> very handy.
>
> To get a summary of 'dlgstlndoug.shp' I would type:
> ogrinfo dlgstlndoug.shp dlgstlndoug -so
>
> The output would be:
> INFO: Open of `dlgstlndoug.shp'
> using driver `ESRI Shapefile' successful.
>
> Layer name: dlgstlndoug
> Geometry: Line String
> Feature Count: 403
> Extent: (285509.105030, 5069677.370139) -
> (334172.948552,
> 5109545.047051)  <-- This is the EXTENT value (minx,
> miny) - (maxx, maxy)
> Layer SRS WKT:
> (unknown)
> FNODE_: Integer (9.0)
> TNODE_: Integer (9.0)
> LPOLY_: Integer (9.0)
> RPOLY_: Integer (9.0)
> LENGTH: Real (19.11)
> DLGSTLNDOU: Integer (9.0)
> DLGSTLND_1: Integer (9.0)
> USCLASS: Integer (6.0)
> FLOW: Integer (1.0)
> S1: Real (6.1)
> S2: Real (6.1)
> S3: Real (6.1)
> S4: Real (6.1)
> S5: Real (6.1)
> S6: Real (6.1)
> S7: Real (6.1)
> S8: Real (6.1)
> S9: Real (6.1)
> S10: Real (6.1)
> ZONE: String (5.0)
> TROUT: String (2.0)
> WSR: String (1.0)
> PWI: String (1.0)
> STREAM__: String (60.0)
> UNSPLIT_IT: String (77.0)
>
>
> Hope that helps!
>
> Brant Anderson
>
>
>
> Oliver Ishmael wrote:
>
> > Hi Guys,
> >
> > How do i find out the EXTENT of my map?
> >
> > Any help greatly appreciated!
> >
> > Cheers
> > Oliver Ishmael
> >
> >
>
_________________________________________________________________
> > It's fast, it's easy and it's free. Get MSN
> Messenger today!
> > http://www.msn.co.uk/messenger
> >
>




_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush



More information about the mapserver-users mailing list