MapServer/MapScript: The Web and Beyond
description
Transcript of MapServer/MapScript: The Web and Beyond
![Page 1: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/1.jpg)
MapServer/MapScript: The Web and Beyond
Minnesota DNR Forestry Resource Assessment MapServer Applications
on and off the Web
![Page 2: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/2.jpg)
Fire Reporting SystemA java/jsp distributed data entry system written to replace aging COBOL systemFire locations recorded using PLS descriptorsMapScript is used to:
Convert PLS descriptors to UTM coordinatesPerform validation checks on locational data
Does the administrative area entered by the user match the administrative area returned by MapScript?
![Page 3: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/3.jpg)
Public Land Survey (PLS) BackgroundStandard US cadastral systemTownships consisting of 36 one square mile sectionsEach section subdivided into 16 forty-acre parcels, or “forties”
Fire Reporting System
![Page 4: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/4.jpg)
Fire Reporting System
Data Entry Screen
![Page 5: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/5.jpg)
Client Web Server Map Server Oracle Server
Data Entry
PLS descriptor
UTM coordinate, RAN
Write to database
RANs Match ?
Yes
NoError, resubmit
ConfirmSuccess
(Java/JSP) (Perl CGI) (JDBC)
Fire Reporting System
Data Processing Flow
![Page 6: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/6.jpg)
PLS-to-UTM ConversionLocation is specified to the PLS forty level1.3 million PLS forties in MNUse staged query:
Lookup township attribute in township layerSet map extent to resultcache bounds from previous queryLookup section attribute in section layerSet map extent to resultcache bounds from previous queryLookup forty attribute in forty layerRetrieve forty shape, nominal center
($shape->getLabelPoint($point)) is our UTM coordinate
Fire Reporting System
![Page 7: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/7.jpg)
Locational Validation
UTM coordinate for fire has been determinedSimple queryByPoint against administrative layer tells us what administrative unit (RAN) that coordinate belongs toReturn coordinate and RAN data to web serverCheck that returned RAN matches user-entered RAN.
Yes, write to databaseNo, return error to user and request resubmission
Fire Reporting System
![Page 8: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/8.jpg)
Setting up MapScript Queries $map = new mapscript::mapObj(undef); $queryLayer = new mapscript::layerObj($map); $queryLayer->{data} = $shpToQuery; $queryLayer->{status} = $mapscript::MS_ON; $queryLayer->{template} = 'dummy'; $qclass = new mapscript::classObj($queryLayer); $rv = $queryLayer->queryByPoint ($map,$point,$mapscript::MS_SINGLE,0); $rv == $mapscript::MS_SUCCESS or warn "Unsuccessful
queryByPoint" and return;
Fire Reporting System
![Page 9: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/9.jpg)
MapScript as a Spatial Data Processing Tool
Orthorecitification Setup
If you have a favorite scripting language that MapScript supports, you can leverage it for (lightweight) spatial data processing tasksSave your expensive proprietary software packages for where you really need themAvoid limitations of proprietary Archaic Macro LanguagesIntegrate with other available scripting environment libraries (eg. Xbase in Perl)
![Page 10: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/10.jpg)
Orthorectification Setup
Orthorecitification Setup
Aiming for production processing of 4-5,000 photos annually, or 60-70 “blocks”.
In order to orthorectify a block of photography, we need:
A shapefile showing estimated photo boundariesA shapefile showing estimated photo effective areasDigital scans of the relevant photosA textfile with “exterior orientation” parametersA mosaic of DOQ images for the area of interest
all stored according to a predefined directory structure and file naming system.
![Page 11: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/11.jpg)
Given:
Orthorecitification Setup
A digital flightline index (shapefile) with:an ID attribute matching photo filenamesa block attribute identifying which block each photo belongs to
A spatial index to the DOQsThe scale and format (eg., 9x9 inch) of the photographyA well-structured photo scan and DOQ library
Then we can…
![Page 12: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/12.jpg)
MapScript It!
Orthorecitification Setup
Convert photo centroids to boundaries
![Page 13: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/13.jpg)
MapScript It!
Orthorecitification Setup
Retrieve appropriate photo scans
![Page 14: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/14.jpg)
MapScript It!
Orthorecitification Setup
Dump required attributes to ASCII text
![Page 15: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/15.jpg)
MapScript It!
Orthorecitification Setup
Find and mosaic required DOQs
queryByFeatures
![Page 16: MapServer/MapScript: The Web and Beyond](https://reader036.fdocuments.in/reader036/viewer/2022062806/56814e79550346895dbc1544/html5/thumbnails/16.jpg)
“When the only tool you have is a hammer, every problem starts to look like a nail.”