From steve.lime at dnr.state.mn.us Fri Oct 1 11:38:42 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Fri, 01 Oct 1999 13:38:42 -0500 Subject: mapserver examples/tutorial Message-ID: Hi: As part of a workshop I'm doing I setup a simple progression of mapserver interfaces online. They are simple, but they show enough stuff to be useful to some folks, I hope. Each example is accompanied by corresponding map files and all templates. You'll need Netscape to access the templates as MSIE likes to parse everything that is text regardless of MIME type. Here's the URL to the first example: http://www.dnr.state.mn.us/mis/gis/gislis99/example1.html There are 5 in the progression. Since these are for use in a talk there's little text on them so here's what to look for in the progression. example 1: - single layer called from an tag, no template so view source example 2: - multiple layers called from an tag, no template so view source example 3: - basic interface, adds pan and zoom - sticky zoom - adds legend, scalebar and reference map example 4: - more advanced interface, adds sticky layer selection - mapfile introduces scale dependent lake layers ...big jump from to 5... example 5: - adds java applet for box area of intrest selection - adds query (mode=nquery), user can select 1 or many (with box) - auto legend replaced with cleaner version (you'll see what I mean) - javascript interface logic - nice example of using javascript to handle query output, does one thing if only one feature is found, and another if more than one is found Server is running 3.2.21. All data is at http://www.dnr.state.mn.us/mis/gis/gislis99/data and graphics are at http://www.dnr.state.mn.us/mis/gis/gislis99/graphics in case any one wants to download stuff to play with themselves. Applet is available on request. Hope it helps. Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us From steve.lime at dnr.state.mn.us Fri Oct 1 13:40:41 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Fri, 01 Oct 1999 15:40:41 -0500 Subject: 3.2.21 Available. Message-ID: Version 3.2.21 is available at the MapServer website. Not a major release at all. Has 3 fixes: - Fixes bug with error traps. If parameters are wrong in map file then the standard ugly old error format is used. Only errors that occur after initial map file parsing are catchable. - Fixed bug that caused one-to-many join processor to kick in cases where an attribute table contained an item name that's a substring of the join name. Thanks Ken. - Added DD (decimal degrees) as a valid unit type. You can now use scale related parameters MINSCALE, MAXSCALE, SYMBOLSCALE and scalebars with lat/lon data. Remember though, the computed scale is only accurate at the equator and should be used internally (i.e. within a map file) only. DD is NOT a valid scalebar unit. Steve From cshorter at optusnet.com.au Fri Oct 1 14:10:51 1999 From: cshorter at optusnet.com.au (Cameron Shorter) Date: Sat, 02 Oct 1999 07:10:51 +1000 Subject: mapserver examples/tutorial References: Message-ID: <37F5235B.AA1D0CF9@optusnet.com.au> Stephen Lime wrote: > > Hi: As part of a workshop I'm doing I setup a simple progression of > mapserver interfaces online. They are simple, but they show enough > stuff to be useful to some folks, I hope. Each example is accompanied > by corresponding map files and all templates. You'll need Netscape > to access the templates as MSIE likes to parse everything that is > text regardless of MIME type. Here's the URL to the first example: > > http://www.dnr.state.mn.us/mis/gis/gislis99/example1.html Great. How about you link it into the mapserver doco pages: http://mapserver.gis.umn.edu/doc.html I'm having problems running example 5. I got "Applet mapimage can't start: ERROR". I'm running Netscape Communicator version 4.6. From rchavez at perseus.tufts.edu Tue Oct 5 12:34:15 1999 From: rchavez at perseus.tufts.edu (Robert Chavez) Date: Tue, 05 Oct 1999 15:34:15 -0400 Subject: mapserver and database connectivity. References: Message-ID: <37FA52B7.5343F019@medusa.perseus.tufts.edu> Greetings, I am wondering if it is possible to send information to mapserver from a database (PostGresql). I'm using the Pg perl module to build a web interface to my PostGres database so users can query and display the data set. The next logical step would be to send the results to Mapserver somehow and plot them on my basemap -- or perhaps create a tranparent gif of the coordinates that could be overlayed on the base map. Has anyone had any experience with this sort of functionality? Thanks, Rob Chavez From bowenj at gaiaenv.com Tue Oct 5 13:11:16 1999 From: bowenj at gaiaenv.com (Jim T. Bowen (GAIA Consultants Inc.)) Date: Tue, 05 Oct 1999 14:11:16 -0600 Subject: mapserver and database connectivity. References: <37FA52B7.5343F019@medusa.perseus.tufts.edu> Message-ID: <37FA5B64.F510D0C4@gaiaenv.com> Hi all, Second this question. We are looking at building similar functionality, but with PHP. When we discover any info. re. this, we will post it. Perhaps Steve has some insight? Cheers, Jim Robert Chavez wrote: > > Greetings, > > I am wondering if it is possible to send information to mapserver from a > database (PostGresql). > > I'm using the Pg perl module to build a web interface to my PostGres > database so users can query and display the data set. The next logical step > would be to send the results to Mapserver somehow and plot them on my > basemap -- or perhaps create a tranparent gif of the coordinates that could > be overlayed on the base map. Has anyone had any experience with this sort > of functionality? > > Thanks, > Rob Chavez -- ___________________________________ GGG G AAA III AAA | Jim T. Bowen, M.Sc., President | G GG A I A | | G G A A I A A |Suite 306, 822-11th Ave. S.W. | G G A A I A A |Calgary, Alberta, Canada T2R 0E5 | G A A I A A |Ph: 403-571-7213 Fax: 403-571-7211| G GGGG A A I A A |_______bowenj at gaiaenv.com__________| G G AAAAA I AAAAA ICQ: 15567315 G G A A I A A http://www.gaiaenv.com G G A A I A A GGGG AAA AAA III AAA AAA From ncarr at guideguide.com Wed Oct 6 03:54:47 1999 From: ncarr at guideguide.com (Nathan Carr) Date: Wed, 06 Oct 1999 11:54:47 +0100 Subject: mapserver and database connectivity. References: <37FA52B7.5343F019@medusa.perseus.tufts.edu> <37FA5B64.F510D0C4@gaiaenv.com> Message-ID: <37FB2A77.BB41A552@guideguide.com> I too am interested in this functionality. Have been looking at wrapping mapserver with SWIG, so I could use perl DBI to access database tables. This seems a bit confusing as there is quite a bit of libraries and structures to include. Alternatively would it be possible to extend the JOIN functionality for joining DBF files to join MySQL/PostGres type tables? Cheerio, nathan > > Hi all, > > Second this question. We are looking at building similar functionality, > but with PHP. When we discover any info. re. this, we will post it. > Perhaps Steve has some insight? > > Cheers, > Jim > > Robert Chavez wrote: > > > > Greetings, > > > > I am wondering if it is possible to send information to mapserver from a > > database (PostGresql). > > > > I'm using the Pg perl module to build a web interface to my PostGres > > database so users can query and display the data set. The next logical step > > would be to send the results to Mapserver somehow and plot them on my > > basemap -- or perhaps create a tranparent gif of the coordinates that could > > be overlayed on the base map. Has anyone had any experience with this sort > > of functionality? > > > > Thanks, > > Rob Chavez > > -- > -- Nathan Carr ncarr at guideguide.com From teb at mallit.fr.umn.edu Wed Oct 6 08:14:15 1999 From: teb at mallit.fr.umn.edu (Thomas E. Burk) Date: Wed, 6 Oct 1999 10:14:15 -0500 (CDT) Subject: fwd: Map Server Test Page up Message-ID: <199910061514.KAA27471@mallit.fr.umn.edu> Forwarded with permission of the author. Tom ------------- Begin Forwarded Message ------------- From pgallen at randomlogic.com Mon Oct 4 22:54:32 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Mon, 04 Oct 1999 22:54:32 -0700 Subject: Map Server Test Page up Message-ID: I have fixed my firewall and my demo pages should now be available to all (I've had a couple people tell me they were successful at browsing the pages). Once again the URL is: 24.5.14.144 http://cx570538-a.elcjn1.sdca.home.com If you're wondering why it's a strange URL or IP: I'm on a cable modem (1MB/sec. connection) using IP masquerading and forwarding on Red Hat Linux 6.0. Even though I have 3 legitimate web sites, none of them are located on my home machine and doing it this way gave me a free and easy method for testing without having to ftp changes all the time. Question: Is there a resource for up to date, low cost (or free) map databases? One of the issues my company has is the availability of current map data for the United States. MapQuest provides it for $20,000/year (and an additional $50,000 for the map server!). If I can find a low cost solution, that'd be great. PGA ------------- End Forwarded Message ------------- From TBanister at SpaceImaging.com Wed Oct 6 09:38:59 1999 From: TBanister at SpaceImaging.com (Banister Trevor) Date: Wed, 6 Oct 1999 10:38:59 -0600 Subject: Map Server Test Page up Message-ID: The USGS (www.usgs.gov) provides a lot of vector data in DLG format. There are several converters out there that will convert the SDTS format to shape. The best method I have found is to use the SDTS2MIF and then the ESRI MIF2SHAPE program. There's probably a better method, let me know if you find it. A site called www.gisdatadepot.com claims to have over a terabyte of vector and raster data from USGS and other sources. DRGs make a nice base image. It's neatly organized and is freely downloadable. ESRI also has a site called www.arcdataonline.com which has a mixture of low cost and free data, mostly in shape format. Finally, Space Imaging sells 5 meter per pixed DOQs from IRS (Indian Remote Sensing, not Internal Revenue Service :-) ) Last time I checked they were going for about $250 each. Eventually we'll be selling these online in MrSID format, but I'm not sure what the release date for that project will be. Data from our new 1 meter per pixel IKONOS bird will be available in the next 60-90 days, but I doubt this will fall into the "cheap" category. Happy hunting. Trevor -----Original Message----- From: Thomas E. Burk [mailto:teb at mallit.fr.umn.edu] Sent: Wednesday, October 06, 1999 9:14 AM To: mapserver-users at lists.gis.umn.edu Subject: fwd: Map Server Test Page up Forwarded with permission of the author. Tom ------------- Begin Forwarded Message ------------- From pgallen at randomlogic.com Mon Oct 4 22:54:32 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Mon, 04 Oct 1999 22:54:32 -0700 Subject: Map Server Test Page up Message-ID: I have fixed my firewall and my demo pages should now be available to all (I've had a couple people tell me they were successful at browsing the pages). Once again the URL is: 24.5.14.144 http://cx570538-a.elcjn1.sdca.home.com If you're wondering why it's a strange URL or IP: I'm on a cable modem (1MB/sec. connection) using IP masquerading and forwarding on Red Hat Linux 6.0. Even though I have 3 legitimate web sites, none of them are located on my home machine and doing it this way gave me a free and easy method for testing without having to ftp changes all the time. Question: Is there a resource for up to date, low cost (or free) map databases? One of the issues my company has is the availability of current map data for the United States. MapQuest provides it for $20,000/year (and an additional $50,000 for the map server!). If I can find a low cost solution, that'd be great. PGA ------------- End Forwarded Message ------------- From pgallen at randomlogic.com Wed Oct 6 11:17:58 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Wed, 06 Oct 1999 11:17:58 -0700 Subject: Map Server Test Page up References: <199910061512.KAA27466@mallit.fr.umn.edu> Message-ID: <37FB9256.5D94F291@randomlogic.com> "Thomas E. Burk" wrote: > [SNIP] > > You are subscribed. You've should have received some mail now. Thanks for > allowing me to post your earlier message. You had been using to > ask questions rather than . > Thanks. Yes, I have received a few messages since last night. > > Last night I added > > queries to the San Diego and Philadelphia maps for lakes, streams and rivers, > some > > landmarks, and key geographic locations. I thinking about recompiling it on my > > "legitimate" web server - a Sparc running FreeBSD - so I can keep it up for a > long > > term period as well as free up my machine for further development. > > > > BTW, I know how to code a router - for determining driving directions from > point A > > to point B - now it's just a matter of doing it. I've suggested to the local > Linux > > user group (Kernel Panic Linux User Group, KPLUG, http://www.kernel-panic.com) > that > > we make it a programing project in the programmers sub-group. No response yet. > > > > Your work is very interesting to us. Thanks for your interest in MapServer. I > hope the router project goes ahead. Keep us posted as you feel appropriate. > Thanks and no problem. I have done a few more improvements to the San Diego map: Major Freeways, Minor Freeways, on/off ramps, Highways, Primary surface Streets, and Secondary Surface are all different colors. I have also adjusted the scale at which they become visible and added the query feature to them. It looks as though MapServer will do everything we need aside from the routing, but routing should be a separate package anyway, so that works out just fine. Now all we need to do is find some good, inexpensive map data that also includes one-way street data (which streets are one-way and which direction they go). PGA From ender at titan.lab.csuchico.edu Thu Oct 7 10:10:41 1999 From: ender at titan.lab.csuchico.edu (ender at titan.lab.csuchico.edu) Date: Thu, 7 Oct 1999 10:10:41 -0700 (PDT) Subject: query Message-ID: To all: I have been attemping to perform a query using mapserver for some time now, and I have not been successful. I have scoured over all of the documentation, as well as the samples, and have not been able to determine what I am missing. I always get the error: An error has occurred in msQueryUsingPoint(): Search returned no results. Could somebody tell me exactly what this error means? Has mapserver found any layers to query? How do you find out? Attached is my .map and template file -Aaron -------------- next part -------------- Compendium of Water Quality Investigations
Municipal Water Quality Investigations Program
1997 Compendium of Water Quality Investigations
Sampling Sites of the Sacramento River Watershed

Central Area

Northern Area Northeastern Area Central Area Eastern Area Southern Area Delta Area SF Bay Area Programs conducting sampling within this area:
- U.S. Geological Survey
- U.S. Geological Survey
- California State University, Chico
- Sand and Salt Creek Watershed Project
- Sacramento River Watershed Program
- Department of Water Resources
-
-
- State Water Resources Control Board
- Department of Fish and Game
- Department of Water Resources
- Department of Water Resources

Navigate: Operation:

-------------- next part -------------- # # Start of map file # NAME c STATUS ON SIZE 400 400 SHADESET /usr/local/share/ms/ms_symbols/symbols/shade.sym MARKERSET /usr/local/share/ms/ms_symbols/symbols/marker.sym LINESET /usr/local/share/ms/ms_symbols/symbols/line.sym EXTENT -251552 65413.4 -119210 272783 UNITS METERS SHAPEPATH "/usr/local/apache/htdocs/compendium/data" IMAGECOLOR 255 255 255 transparent on # LABELOVERLAP FALSE # # web interface # WEB template /usr/local/apache/htdocs/compendium/maps/central.html END # # # Start of reference map # REFERENCE IMAGE "/usr/local/apache/htdocs/compendium/graphics/reference_base.gif" EXTENT -373896 -604675 540167 449854 STATUS ON COLOR -1 -1 -1 OUTLINECOLOR 255 0 0 END # # Start of legend # LEGEND KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END STATUS ON END # # Start of scalebar # SCALEBAR IMAGECOLOR 255 255 255 LABEL COLOR 0 0 0 SIZE SMALL ANTIALIAS END SIZE 350 5 COLOR 255 255 255 BACKGROUNDCOLOR 0 0 0 OUTLINECOLOR 0 0 0 UNITS KILOMETERS INTERVALS 5 STATUS ON END # # Start of layer definitions # # county lines LAYER NAME county TYPE POLYGON STATUS DEFAULT DATA countys LABELITEM county_nam CLASS SYMBOL 0 OUTLINECOLOR 230 230 230 COLOR 255 255 255 BACKGROUNDCOLOR 255 255 255 LABEL SIZE SMALL TYPE truetype font Arial BUFFER 2 COLOR 170 170 170 POSITION cc END END END # county layer # hydro LAYER NAME hydro TYPE LINE STATUS DEFAULT DATA central_hydro TOLERANCE 5 LABELITEM PNAME CLASS COLOR 140 169 190 LABEL SIZE TINY COLOR 81 131 183 END END END # hydro Layer # lakes LAYER NAME lakes TYPE POLYGON STATUS DEFAULT DATA central_lakes TOLERANCE 3 CLASS COLOR 81 131 183 END END # lakes Layer # roads LAYER NAME roads TYPE line status on data roads tolerance 5 class color 168 155 143 end end # roads LAYER NAME sites TYPE POINT STATUS ON DATA central_sites LABELITEM "NAME" CLASSITEM "ORG_TYPE" CLASS SYMBOL 0 COLOR 255 0 0 EXPRESSION "F" LABEL POSITION ul COLOR 255 0 0 backgroundcolor 255 255 255 buffer 2 END END CLASS SYMBOL 0 COLOR 13 130 0 EXPRESSION "S" LABEL POSITION ul COLOR 13 130 0 backgroundcolor 255 255 255 buffer 2 END END CLASS SYMBOL 0 COLOR 211 29 111 EXPRESSION "L" LABEL POSITION ul COLOR 128 0 128 backgroundcolor 255 255 255 buffer 2 END END QUERYITEM "NAME" QUERY EXPRESSION "^-" TEMPLATE "site.html" END END # sites layer # cities LAYER NAME cities TYPE POINT STATUS on DATA central_cities TOLERANCE 10 LABELITEM "NAME" CLASS SYMBOL 0 SIZE 4 LABEL COLOR 0 0 0 POSITION ul PARTIALS off backgroundcolor 200 200 200 buffer 5 END END END # cities layer END # end of mapfile From pgallen at randomlogic.com Thu Oct 7 12:58:49 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Thu, 07 Oct 1999 12:58:49 -0700 Subject: query References: Message-ID: <37FCFB79.3A958F79@randomlogic.com> ender at titan.lab.csuchico.edu wrote: > To all: > > I have been attemping to perform a query using mapserver for some time > now, and I have not been successful. I have scoured over all of the > documentation, as well as the samples, and have not been able to determine > what I am missing. > > I always get the error: > An error has occurred in msQueryUsingPoint(): Search returned no results. > > Could somebody tell me exactly what this error means? Has mapserver found > any layers to query? How do you find out? > > Attached is my .map and template file > > [BIG SNIP] I had the same problem you do, and I believe the reason is the same as well. I'd forgotten to put the "TOLERANCE" line in my map file (see below). The TOLERANCE keyword sets the radius in pixels from the point of the mouse click that a query will take place. The default is 0, meaning the mouse has to be on the exact point of the object to query it. In the case of a large area - a lake, city region, etc. - this is OK, but in the case of a point, it usually isn't. Setting a TOLERANCE of 5 - 10 (possibly more) should do the trick. Hope this helps. PGA > > > LAYER > NAME sites > TYPE POINT > STATUS ON > DATA central_sites # PGA: Added TOLERANCE TOLERANCE 10 #=================== > > LABELITEM "NAME" > CLASSITEM "ORG_TYPE" > CLASS > SYMBOL 0 > COLOR 255 0 0 > EXPRESSION "F" > LABEL > POSITION ul > COLOR 255 0 0 > backgroundcolor 255 255 255 > buffer 2 > END > END > CLASS > SYMBOL 0 > COLOR 13 130 0 > EXPRESSION "S" > LABEL > POSITION ul > COLOR 13 130 0 > backgroundcolor 255 255 255 > buffer 2 > END > END > CLASS > SYMBOL 0 > COLOR 211 29 111 > EXPRESSION "L" > LABEL > POSITION ul > COLOR 128 0 128 > backgroundcolor 255 255 255 > buffer 2 > END > END > > QUERYITEM "NAME" > QUERY > EXPRESSION "^-" > TEMPLATE "site.html" > END > END # sites layer > > # cities > > LAYER > NAME cities > TYPE POINT > STATUS on > DATA central_cities > TOLERANCE 10 > > LABELITEM "NAME" > > CLASS > SYMBOL 0 > SIZE 4 > LABEL > COLOR 0 0 0 > POSITION ul > PARTIALS off > backgroundcolor 200 200 200 > buffer 5 > END > END > END # cities layer > END # end of mapfile From steve.lime at dnr.state.mn.us Thu Oct 7 14:58:40 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Thu, 07 Oct 1999 16:58:40 -0500 Subject: mapserver and database connectivity. Message-ID: I'm wrapping mapserver with SWIG now. Going ok, SWIG ain't perfect but most things I want to do should work. The perl interface allows you to define arbitrary features (points, lines and polygons) and add them to a map composition. This way just about any data source that's accessible from perl can be added to the mapserv. Should be doable from PHP as well although I'm not sure if there is a convientent tool like SWIG for extending it. I actually had a PHP module working a few years ago so I know it can be done. I don't think extending the C codebase is the way to go unless there's a decent library out there. Too much reinventing the wheel otherwise. Steve <<< Nathan Carr 10/ 6 4:56a >>> I too am interested in this functionality. Have been looking at wrapping mapserver with SWIG, so I could use perl DBI to access database tables. This seems a bit confusing as there is quite a bit of libraries and structures to include. Alternatively would it be possible to extend the JOIN functionality for joining DBF files to join MySQL/PostGres type tables? Cheerio, nathan > > Hi all, > > Second this question. We are looking at building similar functionality, > but with PHP. When we discover any info. re. this, we will post it. > Perhaps Steve has some insight? > > Cheers, > Jim > > Robert Chavez wrote: > > > > Greetings, > > > > I am wondering if it is possible to send information to mapserver from a > > database (PostGresql). > > > > I'm using the Pg perl module to build a web interface to my PostGres > > database so users can query and display the data set. The next logical step > > would be to send the results to Mapserver somehow and plot them on my > > basemap -- or perhaps create a tranparent gif of the coordinates that could > > be overlayed on the base map. Has anyone had any experience with this sort > > of functionality? > > > > Thanks, > > Rob Chavez > > -- > -- Nathan Carr ncarr at guideguide.com From pgallen at randomlogic.com Thu Oct 7 17:57:18 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Thu, 07 Oct 1999 17:57:18 -0700 Subject: mapserver and database connectivity. References: Message-ID: <37FD416D.2B2CC44D@randomlogic.com> Stephen Lime wrote: > I'm wrapping mapserver with SWIG now. Going ok, SWIG ain't perfect but most things I want to do should work. The perl interface allows you to define arbitrary features (points, lines and polygons) and add them to a map composition. This way just about any data source that's accessible from perl can be added to the mapserv. > > Should be doable from PHP as well although I'm not sure if there is a convientent tool like SWIG for extending it. I actually had a PHP module working a few years ago so I know it can be done. > > I don't think extending the C codebase is the way to go unless there's a decent library out there. Too much reinventing the wheel otherwise. > I'm very interested in this as it seems it would apply directly to what we want to do - insert GPS data points into a map. I could do this now by simply converting the data into data sets that mapserver can read and simply reading that data, but if there's another, easier method... I know nothing about SWIG, not even what it stands for, but I am learning perl. With that, what is SWIG? (Scientific Wild Insane Guess?! :) PGA From cshorte2 at csc.com Thu Oct 7 18:56:53 1999 From: cshorte2 at csc.com (cshorte2 at csc.com) Date: Fri, 8 Oct 1999 11:56:53 +1000 Subject: mapserver and database connectivity. Message-ID: <85256804.000B4E52.00@csc.com> I assume they are refering to http://www.swig.org/ >From the homepage: SWIG is a software development tool that connects programs written in C, C++, and Objective-C with a variety of high-level programming languages. SWIG is primarily used with common scripting languages such as Perl, Python, and Tcl/Tk, but has also been extended to include languages such as Java, Eiffel, and Guile. SWIG is most commonly used to create high-level interpreted programming environments, systems integration, and as a tool for building user interfaces. SWIG may be freely used, distributed, and modified for commercial or noncommercial use. > I know nothing about SWIG, not even what it stands for, > but I am learning perl. With that, what is SWIG? (Scientific Wild Insane Guess?! :) From pgallen at randomlogic.com Fri Oct 8 13:15:28 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Fri, 08 Oct 1999 13:15:28 -0700 Subject: US Street Map Message-ID: <37FE50E0.5C055B26@randomlogic.com> I plan to put up a map of the entire US including every street, freeway, city, county, etc. I have all the data, but I need to convert it into the proper format. The data files are currently in TIGER/Line format as text files (see http://www.perens.com or fpt://ftp.perens.com/pub/US-map for more info). Each file is a separate TIGER/Line record type. I've heard there are a lot of converter programs available. Is there a converter for this format that will put the data in the format necessary for MapServer - to convert it into ESRI format .shp, .shx, and .dbf files? Thanks, PGA P.S. - If anyone is wanting to D/L the data, fair warning: it took me most of the night on my 1.5MB/sec cable modem. It's 2.6GB of bzipped text files in 57 different directories. I'm glad I have NcFTP! :) From steve.lime at dnr.state.mn.us Fri Oct 8 13:17:06 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Fri, 08 Oct 1999 15:17:06 -0500 Subject: request for comments... Message-ID: I'm in the midst of implementing a new feature for 3.3 called "query maps". In a nutshell they allow you to use the results of a query to generate a map. The constructor is very simple, you specify 3 parameters status, style and a hilite color (if necessary). I envision 3 styles of query maps: NORMAL - with this style the results of the query would be used to define a map extent and then the map would be draw as normal with no special attention payed to the query polygons. This would allow for item/value queries to generate a map in one step rather than the current two. Embedding maps if you know nothing about coordinates would be much easier this way. HILITE - the map would be drawn as normal, but features that are part of the query result set would be drawn using the hilite color. Very ArcView-ish. SELECTED - for queried layers, only those features that are part of the result set would be drawn. They would be rendered normally with no hilites. Especially useful with item/value queries. Non-query layers would be drawn as normal. Note that queries are limited to shapefiles only. Tiled data is not queryable. (Using perl and data from other sources will in effect give you query access to those sources since drawing is done feature by feature.) Anyway, I'd like to get comments from folks on this extension. Other ideas and so on. I can envision some very sophisticated apps just using what I've outlined above. Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us From cshorter at optusnet.com.au Fri Oct 8 14:05:47 1999 From: cshorter at optusnet.com.au (Cameron Shorter) Date: Sat, 09 Oct 1999 07:05:47 +1000 Subject: request for comments... References: Message-ID: <37FE5CAB.21541C0A@optusnet.com.au> Yes, I can see myself using such a feature. What I am working toward is an interface to modify map shapes. The way I see it working is: Split my web page into windows. Window 1, the map window, contains a map. From this window, an operator can select a feature (like a road), and all the details of that object are copied to window 2. The operator can also enter a new feature, or update an old feature by entering multiple points on the map window. Window 2, the feature details window, contains all the vertex and data about the selected feature. When the opertor has finished updating the feature, they press the SUBMIT button and the details are sent to the database to be updated. Stephen Lime wrote: > > I'm in the midst of implementing a new feature for 3.3 called "query maps". > In a nutshell they allow you to use the results of a query to generate a map. > The constructor is very simple, you specify 3 parameters status, style and > a hilite color (if necessary). I envision 3 styles of query maps: > > NORMAL - with this style the results of the query would be used to define > a map extent and then the map would be draw as normal with no special > attention payed to the query polygons. This would allow for item/value > queries to generate a map in one step rather than the current two. Embedding > maps if you know nothing about coordinates would be much easier this way. > > HILITE - the map would be drawn as normal, but features that are part of > the query result set would be drawn using the hilite color. Very ArcView-ish. > > SELECTED - for queried layers, only those features that are part of the > result set would be drawn. They would be rendered normally with no hilites. > Especially useful with item/value queries. Non-query layers would be drawn > as normal. > > Note that queries are limited to shapefiles only. Tiled data is not queryable. > > (Using perl and data from other sources will in effect give you query access > to those sources since drawing is done feature by feature.) > > Anyway, I'd like to get comments from folks on this extension. Other ideas and > so on. I can envision some very sophisticated apps just using what I've outlined > above. > > Steve > > Stephen Lime > Internet Applications Analyst > MIS Bureau - MN DNR > > (651) 297-2937 > steve.lime at dnr.state.mn.us From pcameron at gis.umn.edu Fri Oct 8 14:46:32 1999 From: pcameron at gis.umn.edu (Paul Cameron) Date: Fri, 8 Oct 1999 16:46:32 -0500 (CDT) Subject: request for comments... In-Reply-To: Message-ID: I am very much in favor of seeing something like this implemented. I'm got an app running now that sounds very similar to the HILITE mode but its a very convoluted process that I'd love to be able to clean up. I've got a couple comments/questions on them below. On Fri, 8 Oct 1999, Stephen Lime wrote: > NORMAL - with this style the results of the query would be used to define > a map extent and then the map would be draw as normal with no special > attention payed to the query polygons. This would allow for item/value > queries to generate a map in one step rather than the current two. Embedding > maps if you know nothing about coordinates would be much easier this way. If I understand this correctly than this will remove the problem of having to know the mapextent of a polygon that we want to zoom to. Will we be able to specify a different mapfile for the new map that will be created? This would be very useful for nesting interfaces together. > > HILITE - the map would be drawn as normal, but features that are part of > the query result set would be drawn using the hilite color. Very ArcView-ish. I envision this working by passing an array of selected features to mapserv which would color them in for me. Will we be able to specify the color used in the hilite and can we make the highlight color transparent? This one might be stretching but for the application I've got going right now I need to break the highlighted features into different classes. Could multiple classes be supported, possibily using hashes in perl? I'm also curious how this will be integrated into mapscript. I don't know how mapscript will be work but I could see this being closely tied to using mapscript. paul > > SELECTED - for queried layers, only those features that are part of the > result set would be drawn. They would be rendered normally with no hilites. > Especially useful with item/value queries. Non-query layers would be drawn > as normal. > > Note that queries are limited to shapefiles only. Tiled data is not queryable. > > (Using perl and data from other sources will in effect give you query access > to those sources since drawing is done feature by feature.) > > Anyway, I'd like to get comments from folks on this extension. Other ideas and > so on. I can envision some very sophisticated apps just using what I've outlined > above. > > Steve > > Stephen Lime > Internet Applications Analyst > MIS Bureau - MN DNR > > (651) 297-2937 > steve.lime at dnr.state.mn.us > From sphillip at mail.esrp.org Fri Oct 8 15:04:40 1999 From: sphillip at mail.esrp.org (Scott Phillips) Date: Fri, 08 Oct 1999 15:04:40 PDT Subject: US Street Map (fwd) Message-ID: <199910082204.PAA26337@mail.esrp.org> Paul, There is an converter for windows that costs about $100.00 called TGR2SHP. I used it to convert the State of California set to shape files and it worked great. It lets you do the conversions straight from the .ZIP files and you can do them in batch. See http://www.gistools.com if you want more info. Scott Scott Phillips scott at phillipsgis.com > > I plan to put up a map of the entire US including every street, freeway, city, > county, etc. I have all the data, but I need to convert it into the proper > format. The data files are currently in TIGER/Line format as text files (see > http://www.perens.com or fpt://ftp.perens.com/pub/US-map for more info). Each > file is a separate TIGER/Line record type. I've heard there are a lot of > converter programs available. Is there a converter for this format that will put > the data in the format necessary for MapServer - to convert it into ESRI format > .shp, .shx, and .dbf files? > > Thanks, > > PGA > > P.S. - If anyone is wanting to D/L the data, fair warning: it took me most of > the night on my 1.5MB/sec cable modem. It's 2.6GB of bzipped text files in 57 > different directories. I'm glad I have NcFTP! :) > > From pgallen at randomlogic.com Fri Oct 8 15:21:39 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Fri, 08 Oct 1999 15:21:39 -0700 Subject: US Street Map (fwd) References: <199910082204.PAA26337@mail.esrp.org> Message-ID: <37FE6E73.D395CFBD@randomlogic.com> Scott Phillips wrote: > Paul, > > There is an converter for windows that costs about $100.00 called TGR2SHP. > I used it to convert the State of California set to shape files and it > worked great. It lets you do the conversions straight from the .ZIP files > and you can do them in batch. See http://www.gistools.com if you want > more info. > This will do the trick but is there a UNIX/Linux equivalent. (I prefer UNIX/Linux over the alternative, but I can use TGR2SHP if I must). Thanks, PGA From nhv at cape.com Fri Oct 8 16:57:37 1999 From: nhv at cape.com (Norman Vine) Date: Fri, 8 Oct 1999 19:57:37 -0400 Subject: US Street Map In-Reply-To: <37FE50E0.5C055B26@randomlogic.com> Message-ID: <000001bf11e9$024b3a80$1637ba8c@nhv> Paul G. Allen writes: >Is there a converter for this >format that will put the data in the format necessary for MapServer >to convert it into ESRI format .shp, .shx, and .dbf files? > Alan Crosswell has GPL'd 'C' source for making maps from Tiger 94-95 data at http://www.users.cloud9.net/~alan/ham/aprs/tig2aprs.zip that could be used as input to Frank Warmerdam's Shapelib package http://members.home.com/warmerda To make the shapefiles. Hopefully the format did not changed that much from 95 to 97 Good Luck Norman Vine From pnaciona at gis.umn.edu Fri Oct 8 11:02:37 1999 From: pnaciona at gis.umn.edu (Pericles S. Nacionales) Date: Fri, 8 Oct 1999 19:02:37 +0100 Subject: request for comments... References: Message-ID: <002c01bf11b7$4e930ad0$9a496580@gis.umn.edu> Steve, This is perfect for one of our TerraSIP apps--the TM Availability tool. We can generate the map with the query results (the dates LandSat 5 or 7 passes the Upper Great Lakes), have the scene they selected highlighted, and have a GOES image alongside for users to see if it's a clear or cloudy day. All in one query... this is good. I assume you can then requery from the new map? Thanks, Perry PS: Terrasip prototype MapServer apps are at http://terrasip.gis.umn.edu/projects Pericles S. Nacionales Research Assistant Forest Resources Dept. University of Minnesota 612 625 5765 pnaciona at gis.umn.edu ----- Original Message ----- From: Stephen Lime To: Sent: Friday, October 08, 1999 9:17 PM Subject: request for comments... > I'm in the midst of implementing a new feature for 3.3 called "query maps". > In a nutshell they allow you to use the results of a query to generate a map. > The constructor is very simple, you specify 3 parameters status, style and > a hilite color (if necessary). I envision 3 styles of query maps: > > NORMAL - with this style the results of the query would be used to define > a map extent and then the map would be draw as normal with no special > attention payed to the query polygons. This would allow for item/value > queries to generate a map in one step rather than the current two. Embedding > maps if you know nothing about coordinates would be much easier this way. > > HILITE - the map would be drawn as normal, but features that are part of > the query result set would be drawn using the hilite color. Very ArcView-ish. > > SELECTED - for queried layers, only those features that are part of the > result set would be drawn. They would be rendered normally with no hilites. > Especially useful with item/value queries. Non-query layers would be drawn > as normal. > > Note that queries are limited to shapefiles only. Tiled data is not queryable. > > (Using perl and data from other sources will in effect give you query access > to those sources since drawing is done feature by feature.) > > Anyway, I'd like to get comments from folks on this extension. Other ideas and > so on. I can envision some very sophisticated apps just using what I've outlined > above. > > Steve > > Stephen Lime > Internet Applications Analyst > MIS Bureau - MN DNR > > (651) 297-2937 > steve.lime at dnr.state.mn.us > From steve.lime at dnr.state.mn.us Fri Oct 8 20:03:59 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Fri, 08 Oct 1999 22:03:59 -0500 Subject: request for comments... Message-ID: Think of query maps as regular maps. Instead of pan/zoom you do a query of some sort. They don't make sense in all cases but should pretty helpful in others. The output template could easily be another mapserver interface. Preserving queries may be tough though. Steve <<< "Pericles S. Nacionales" 10/ 8 7:02p >>> Steve, This is perfect for one of our TerraSIP apps--the TM Availability tool. We can generate the map with the query results (the dates LandSat 5 or 7 passes the Upper Great Lakes), have the scene they selected highlighted, and have a GOES image alongside for users to see if it's a clear or cloudy day. All in one query... this is good. I assume you can then requery from the new map? Thanks, Perry PS: Terrasip prototype MapServer apps are at http://terrasip.gis.umn.edu/projects Pericles S. Nacionales Research Assistant Forest Resources Dept. University of Minnesota 612 625 5765 pnaciona at gis.umn.edu ----- Original Message ----- From: Stephen Lime To: Sent: Friday, October 08, 1999 9:17 PM Subject: request for comments... > I'm in the midst of implementing a new feature for 3.3 called "query maps". > In a nutshell they allow you to use the results of a query to generate a map. > The constructor is very simple, you specify 3 parameters status, style and > a hilite color (if necessary). I envision 3 styles of query maps: > > NORMAL - with this style the results of the query would be used to define > a map extent and then the map would be draw as normal with no special > attention payed to the query polygons. This would allow for item/value > queries to generate a map in one step rather than the current two. Embedding > maps if you know nothing about coordinates would be much easier this way. > > HILITE - the map would be drawn as normal, but features that are part of > the query result set would be drawn using the hilite color. Very ArcView-ish. > > SELECTED - for queried layers, only those features that are part of the > result set would be drawn. They would be rendered normally with no hilites. > Especially useful with item/value queries. Non-query layers would be drawn > as normal. > > Note that queries are limited to shapefiles only. Tiled data is not queryable. > > (Using perl and data from other sources will in effect give you query access > to those sources since drawing is done feature by feature.) > > Anyway, I'd like to get comments from folks on this extension. Other ideas and > so on. I can envision some very sophisticated apps just using what I've outlined > above. > > Steve > > Stephen Lime > Internet Applications Analyst > MIS Bureau - MN DNR > > (651) 297-2937 > steve.lime at dnr.state.mn.us > From TBanister at SpaceImaging.com Sat Oct 9 10:09:14 1999 From: TBanister at SpaceImaging.com (Banister Trevor) Date: Sat, 9 Oct 1999 11:09:14 -0600 Subject: US Street Map Message-ID: If you have ArcView, there is a free Avenue script at: http://gis.esri.com/arcscripts/details.cfm?CFGRIDKEY=1270853054 -----Original Message----- From: Paul G. Allen [mailto:pgallen at randomlogic.com] Sent: Friday, October 08, 1999 2:15 PM To: MapServer Users List Subject: US Street Map I plan to put up a map of the entire US including every street, freeway, city, county, etc. I have all the data, but I need to convert it into the proper format. The data files are currently in TIGER/Line format as text files (see http://www.perens.com or fpt://ftp.perens.com/pub/US-map for more info). Each file is a separate TIGER/Line record type. I've heard there are a lot of converter programs available. Is there a converter for this format that will put the data in the format necessary for MapServer - to convert it into ESRI format .shp, .shx, and .dbf files? Thanks, PGA P.S. - If anyone is wanting to D/L the data, fair warning: it took me most of the night on my 1.5MB/sec cable modem. It's 2.6GB of bzipped text files in 57 different directories. I'm glad I have NcFTP! :) From imap at chesapeake.net Sat Oct 9 16:45:14 1999 From: imap at chesapeake.net (imap at chesapeake.net) Date: Sat, 09 Oct 1999 19:45:14 -0400 Subject: US Street Map References: Message-ID: <37FFD38A.1C49BF43@chesapeake.net> Banister (very cool name), That TGR2SHP is the way to go (www.gistools.com) on this one. It does ENTIRE cdroms in batches... (I had requested this feature about a year ago, and he did it). There is so much data, you have to automate as much as possible. I work with this Tiger data all the time and that product is just the ticket... The only trick is to post-process the files to get them in the correct projection. I wrote my own projection tool for doing this... using PROJ4 which can be found on the net as well... ftp://kai.er.usgs.gov/pub/PROJ.4/ Regards, Chris Stuber (mapsurfer) Banister Trevor wrote: > > If you have ArcView, there is a free Avenue script at: > http://gis.esri.com/arcscripts/details.cfm?CFGRIDKEY=1270853054 > > -----Original Message----- > From: Paul G. Allen [mailto:pgallen at randomlogic.com] > Sent: Friday, October 08, 1999 2:15 PM > To: MapServer Users List > Subject: US Street Map > > I plan to put up a map of the entire US including every street, freeway, > city, > county, etc. I have all the data, but I need to convert it into the proper > format. The data files are currently in TIGER/Line format as text files (see > http://www.perens.com or fpt://ftp.perens.com/pub/US-map for more info). > Each > file is a separate TIGER/Line record type. I've heard there are a lot of > converter programs available. Is there a converter for this format that will > put > the data in the format necessary for MapServer - to convert it into ESRI > format > .shp, .shx, and .dbf files? > > Thanks, > > PGA > > P.S. - If anyone is wanting to D/L the data, fair warning: it took me most > of > the night on my 1.5MB/sec cable modem. It's 2.6GB of bzipped text files in > 57 > different directories. I'm glad I have NcFTP! :) -- Chris Stuber (mapsurfer) 287 Southland Ct Dunkirk, MD 20754 From cshorter at optusnet.com.au Sun Oct 10 03:14:45 1999 From: cshorter at optusnet.com.au (Cameron Shorter) Date: Sun, 10 Oct 1999 20:14:45 +1000 Subject: Updating Shapefiles, and data integrity Message-ID: <38006715.1C3C48C0@optusnet.com.au> -------- Original Message -------- Subject: Re: request for comments... Date: Sun, 10 Oct 1999 19:16:24 +1000 From: Cameron Shorter Reply-To: camerons at cat.org.au To: Stephen Lime References: Stephen Lime wrote: > > Maintaining data integrity is going to be a big issue. I was at our state GIS conference and got to chat with Jack Dangermond from ESRI about the MapServer and their new ArcIMS product. Seems they're having trouble with this editing stuff. Shapefiles just aren't a transactional environment so unless you can assure yourself of single user access there's always the potential for multiple concurrent edits. Then there's the issue of quality control. I think the solution needs to offer immediate update and delayed update. ArcIMS, as I understand it, caches updates until an operator on the server site commits the edits to the main database. This operator could be a cron process I suppose that could handle locking while > edits are processed. I think this may be a good approach as you could do some simple transaction management- review, edit and delete, once the initial work was done. Edits could be stored in a shapefile along with attributes and enough additional information to commit the shape - source shapefile, shape (or is a new one), type of edit (replace, attribute change) etc. > > Anyway, just my thoughts... > > Steve I'm glad to hear I'm not the only one having problems with updating shapefiles. :) >From looking at the shapefile definition paper, you can see that there is an index file .SHX which points to a .SHP file which has variable length records. There are a few problems that I can see. Please verify if any of these are correct or not. 1. Deleting an old object. I think this can be handled by setting the shapetype to a NULL shape. 2. Increasing the number of vertices of a shape, and hence increasing the record size. I think the best way to handle this is to remove the old shape by setting its shapetype to NULL, and to add a new shape to the end of the .SHP file. The pointer in the .SHX file will now have to be redirected to the end of the .SHP file. This now means that the order of the .SHP file and the .SHX file will not match, which will reduce query speeds, so periodically the datafiles would need to be rebuilt. 3. There is an issue with the .SHP file and .SHX file becoming out of sync. Basically, when a shape is updated, first the .SHP file will need to be updated, and some time later the .SHX file will be updated. There is a window of opportunity where the files will be out of sync. I was planning to address this by either putting in a lock file, or changing read/write permissions to lock the files while the database is out of sync. This means that some reads of the database will fail because the database is updating. 4. I'm not sure what the best way is to link into a SQL database. If the shapefile is only added to, then the best way to reference an object is by using the index in the .SHX file. However, if you delete an object, should you rebuild the .SHX file? This will keep the index file from blowing out, but all the indexes will change and hence the SQL database will reference the wrong indices. Happy for any advice. Cameron. From vrraju at gis.umn.edu Mon Oct 11 08:38:09 1999 From: vrraju at gis.umn.edu (Vatsavai Ranga Raju) Date: Mon, 11 Oct 1999 10:38:09 -0500 Subject: MapServer List Archive References: <37EDA085.8BFD550B@optusnet.com.au> <37EDAABC.EDDC798@gis.umn.edu> Message-ID: <38020461.1799DBCE@gis.umn.edu> To mapserver-users list members To improve the usefulness of archives, we have decided to update the html archives every mid night. You can access the html archives from the following URL: http://mapserver.gis.umn.edu/mapserver-users-list-archives/index.html Raju ---- Vatsavai Ranga Raju wrote: > Hi Cameron > > Sure, email interface (i.e - get list-name file-name from majordomo) is not a convenient > method to go through mail archives. But there are utilities (like mhonarc) which will convert > email list to html files. Initially there is very little traffic for mapserver-users lists, so we > thought monthly archives are sufficient (for html interface, but users can get up-to-date > archive files through email interface). Ofcourse we can archive them at frequent intervals, > if there is sufficient traffic and need. > > Raju. > ---- > > Cameron Shorter wrote: > > > I'd be really impressed if the archive could be made more recent. Month old > > archives often arn't good enough for me, and I find the email interface messy. > > > > Cameron > > > > Stephen Lime wrote: > > > > > > Yup, the University maintains a web version. It's a bit out of date *hint*, but I know they plan on keeping it up. From pgallen at randomlogic.com Mon Oct 11 15:24:38 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Mon, 11 Oct 1999 15:24:38 -0700 Subject: Tiling maps Message-ID: <380263A6.B00A5039@randomlogic.com> I am ready to tile maps but I'm not sure how to do this. I have fairly good data for the entire US, separated by county. What I want to do is to be able to display a map of any size from a single county to several counties, possibly an entire state. My question is, how would I display two adjacent counties as a single map? PGA From steve.lime at dnr.state.mn.us Tue Oct 12 07:25:07 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Tue, 12 Oct 1999 09:25:07 -0500 Subject: Tiling maps Message-ID: That's where the tiling comes in. You need a county index shapefile. The index is just a normal shapefile with a attribute called "location" that contains the path to the directory that contains data for that tile. The path can be a full path (eg. starts with /) or it can be relative to the location of the mapfile. (I think that's correct) To enable tiling you simply use the INDEX keyword (followed by the index shapefile name) in a layer section. The MapServer uses the index to figure out which tiles to process. Then, each one is processed in turn as if it was a single shapefile. Only drag is that tiled layers are not searchable yet. A number of MapServer users are using this feature and are in a position to comment about specific problems you might run in to. Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us >>> "Paul G. Allen" 10/11 5:24 PM >>> I am ready to tile maps but I'm not sure how to do this. I have fairly good data for the entire US, separated by county. What I want to do is to be able to display a map of any size from a single county to several counties, possibly an entire state. My question is, how would I display two adjacent counties as a single map? PGA From bfraser at geoanalytic.ab.ca Tue Oct 12 07:40:49 1999 From: bfraser at geoanalytic.ab.ca (bfraser) Date: Tue, 12 Oct 1999 08:40:49 -0600 Subject: Tiling maps References: <380263A6.B00A5039@randomlogic.com> Message-ID: <001801bf14bf$c6b0fc60$390002c0@servo> Paul, As long as you don't want to query the data in the tiles, you can use the tiling feature in MapServer. 1. Create a shapefile containing the outlines of the counties 2. Create a column in the shapefile with the name of LOCATION 3. For each county outline shape in the shapefile, enter the filename of the county shapefile in the LOCATION column (leave off the .shp ) 4. Edit the "map" file. Add an entry for TILE at the top. This contains the path to the directory containing county files. It is prepended to the name in the LOCATION column to build the full path to the shapefiles. Add a LAYER entry with an INDEX entry. The index is the name of the shapefile you created in step 1. A couple of notes about tiles: 1. The tile index shapefile and the "data" shapefiles must be in the same coordinate system. 2. Mapserver will not query data in tiled files. Brent ----- Original Message ----- From: Paul G. Allen To: MapServer Users List Sent: Monday, October 11, 1999 4:24 PM Subject: Tiling maps > I am ready to tile maps but I'm not sure how to do this. I have fairly good data > for the entire US, separated by county. What I want to do is to be able to > display a map of any size from a single county to several counties, possibly an > entire state. My question is, how would I display two adjacent counties as a > single map? > > PGA > > From bfraser at geoanalytic.ab.ca Tue Oct 12 09:00:08 1999 From: bfraser at geoanalytic.ab.ca (bfraser) Date: Tue, 12 Oct 1999 10:00:08 -0600 Subject: Updating Shapefiles, and data integrity References: <38006715.1C3C48C0@optusnet.com.au> Message-ID: <006c01bf14ca$e68f3f00$390002c0@servo> see my comments below... Brent Fraser ----- Original Message ----- From: Cameron Shorter To: mapserver Sent: Sunday, October 10, 1999 4:14 AM Subject: Updating Shapefiles, and data integrity > > > -------- Original Message -------- > Subject: Re: request for comments... > Date: Sun, 10 Oct 1999 19:16:24 +1000 > From: Cameron Shorter > Reply-To: camerons at cat.org.au > To: Stephen Lime > References: > > > > Stephen Lime wrote: > > > > Maintaining data integrity is going to be a big issue. I was at our state GIS conference and got to chat with Jack Dangermond from ESRI about the MapServer and their new ArcIMS product. Seems they're having trouble with this editing stuff. Shapefiles just aren't a transactional environment so unless you can assure yourself of single user access there's always the potential for multiple concurrent edits. Then there's the issue of quality control. I think the solution needs to offer immediate update and delayed update. ArcIMS, as I understand it, caches updates until an operator on the server site commits the edits to the main database. This operator could be a cron process I suppose that could handle locking while > > edits are processed. I think this may be a good approach as you could do some simple transaction management- review, edit and delete, once the initial work was done. Edits could be stored in a shapefile along with attributes and enough additional information to commit the shape - source shapefile, shape (or is a new one), type of edit (replace, attribute change) etc. > > > > Anyway, just my thoughts... > > > > Steve > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v Enterprise-wide editing can require a lot of infrastructure to support it. A large-scale implementation might include (this is only one scenario): o a data repository / warehouse / database o project workspaces for editing o a "view-only" copy of the data Typical workflows would include: 1. Edit: operator identifies features in warehouse for editing, locks them, extracts them to the project workspace. The features are edited, possibly reviewed, then checked back into the warehouse. This is sometimes known as a "long transaction" Some things that may be important: 1. feature level locking (as apposed to file locking) to prevent simultaneous editing 2. feature lineage tracking: timestamps, feature "retirement" instead of deletion 3. theme security: certain departments can edit only specific themes 2. Copy: at a pre-determined schedule, the warehouse is copied to the "View-only" database. This may include re-formatting, indexing and distributing the data to get better performance for viewing. Depending on the edits, the copy could be once a day, once a month, etc. The good thing about this approach is that the user (viewer/querier) has a stable data set to operate on. The bad thing is it might not be up to date. 3. Viewing: the data is queried and rendered for thick and thin client apps. Of course all this might be unnecessary if you only have occasional edits and a few viewers.... vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v > I'm glad to hear I'm not the only one having problems with updating > shapefiles. :) > > >From looking at the shapefile definition paper, you can see that there is an > index file .SHX which points to a .SHP file which has variable length records. > > There are a few problems that I can see. Please verify if any of these are > correct or not. > 1. Deleting an old object. I think this can be handled by setting the > shapetype to a NULL shape. > > 2. Increasing the number of vertices of a shape, and hence increasing the > record size. I think the best way to handle this is to remove the old shape > by setting its shapetype to NULL, and to add a new shape to the end of the > .SHP file. The pointer in the .SHX file will now have to be redirected to the > end of the .SHP file. This now means that the order of the .SHP file and the > .SHX file will not match, which will reduce query speeds, so periodically the > datafiles would need to be rebuilt. > > 3. There is an issue with the .SHP file and .SHX file becoming out of sync. > Basically, when a shape is updated, first the .SHP file will need to be > updated, and some time later the .SHX file will be updated. There is a window > of opportunity where the files will be out of sync. I was planning to address > this by either putting in a lock file, or changing read/write permissions to > lock the files while the database is out of sync. > This means that some reads of the database will fail because the database is > updating. > > 4. I'm not sure what the best way is to link into a SQL database. If the > shapefile is only added to, then the best way to reference an object is by > using the index in the .SHX file. However, if you delete an object, should > you rebuild the .SHX file? This will keep the index file from blowing out, > but all the indexes will change and hence the SQL database will reference the > wrong indices. vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v How about a unique key stored in the dbf file used to join to the SQL database? This would allow for many shapefiles joining to a single SQL table (might be useful if the data is tiled.) vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v > > Happy for any advice. > > Cameron. > From steve.lime at dnr.state.mn.us Tue Oct 12 14:36:38 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Tue, 12 Oct 1999 16:36:38 -0500 Subject: Updating Shapefiles, and data integrity Message-ID: The more I think about this, the more I understand why I never attempted it. Locking is a real pain in the CGI world. When do you lock, when a record is requested or when edits are submitted? If the latter then there is a chance more than one person could request the same shape. I don't think that on-the-fly edits are possible robustly. Somehow I think edits need to be cached and commited "behind the scenes". It's essential the shp, shx and dbf records remain in sync. What about something like this: Assuming the there is a mechanism to request a shape and attributes (and a checkout time) and make changes. A user now sends back some edits. This causes a record to be written to a "pending" database. What actually gets saved are things like source shapefile, feature id (-1 for new), timestamp, etc. The actually edits get saved in some format (shapefile) as a file whose name can be reconstructed from elements in the pending database. Now, periodically a process could go through and commit the edits in the pending database to production (not web accessible) versions. When this is finished the updated stuff could be swapped in for the old stuff and the pending database purged (in part). The commiting of the shapes would essentially involve rebuilding the shapefile from the user edits and the production version (i.e. pick the edited version if it exists). Put a lock in place while versions are being swapped and remove it when done, probably only a few seconds. You could even maintain a history by saving previous versions for some period of time or retiring shapes to some external format (shapefile). As requests for shapes come in a quick check of the pending database could be used to identify re-edits. If a timestamp is set when a shape is requested then it could be compared against edits in the pending database to identify possible problems. If a user requests an edited shape just send the pending edits as if they were part of the current shapefile. New shapes are just added to the pending database and make their way into the main database as part of the update process. Sounds complicated but really is only 2 processes, 1 database and a bunch of cached edits. Timestamps can help alleviate simultaneous edits and a the worst thing a user would see would be a message like "The record you're submitting has changed since you requested it, cannot process the edit. Would you like to work from the edited version?". Again, without some sort of a persistant connection I doubt that real-time editing is possible. One could bump the commit time up to a few minutes or even seconds though so it would certainly seem real-time. (Cameron, this approach would involve no editing of Frank's shapelib at all since all you're doing is reading and writing individual records. The effort goes into getting all the communication working right. Could even be a perl script with system calls to the shapelib utils for creating files and adding info.) Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us >>> "bfraser" 10/12 11:00 AM >>> see my comments below... Brent Fraser ----- Original Message ----- From: Cameron Shorter To: mapserver Sent: Sunday, October 10, 1999 4:14 AM Subject: Updating Shapefiles, and data integrity > > > -------- Original Message -------- > Subject: Re: request for comments... > Date: Sun, 10 Oct 1999 19:16:24 +1000 > From: Cameron Shorter > Reply-To: camerons at cat.org.au > To: Stephen Lime > References: > > > > Stephen Lime wrote: > > > > Maintaining data integrity is going to be a big issue. I was at our state GIS conference and got to chat with Jack Dangermond from ESRI about the MapServer and their new ArcIMS product. Seems they're having trouble with this editing stuff. Shapefiles just aren't a transactional environment so unless you can assure yourself of single user access there's always the potential for multiple concurrent edits. Then there's the issue of quality control. I think the solution needs to offer immediate update and delayed update. ArcIMS, as I understand it, caches updates until an operator on the server site commits the edits to the main database. This operator could be a cron process I suppose that could handle locking while > > edits are processed. I think this may be a good approach as you could do some simple transaction management- review, edit and delete, once the initial work was done. Edits could be stored in a shapefile along with attributes and enough additional information to commit the shape - source shapefile, shape (or is a new one), type of edit (replace, attribute change) etc. > > > > Anyway, just my thoughts... > > > > Steve > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v Enterprise-wide editing can require a lot of infrastructure to support it. A large-scale implementation might include (this is only one scenario): o a data repository / warehouse / database o project workspaces for editing o a "view-only" copy of the data Typical workflows would include: 1. Edit: operator identifies features in warehouse for editing, locks them, extracts them to the project workspace. The features are edited, possibly reviewed, then checked back into the warehouse. This is sometimes known as a "long transaction" Some things that may be important: 1. feature level locking (as apposed to file locking) to prevent simultaneous editing 2. feature lineage tracking: timestamps, feature "retirement" instead of deletion 3. theme security: certain departments can edit only specific themes 2. Copy: at a pre-determined schedule, the warehouse is copied to the "View-only" database. This may include re-formatting, indexing and distributing the data to get better performance for viewing. Depending on the edits, the copy could be once a day, once a month, etc. The good thing about this approach is that the user (viewer/querier) has a stable data set to operate on. The bad thing is it might not be up to date. 3. Viewing: the data is queried and rendered for thick and thin client apps. Of course all this might be unnecessary if you only have occasional edits and a few viewers.... vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v > I'm glad to hear I'm not the only one having problems with updating > shapefiles. :) > > >From looking at the shapefile definition paper, you can see that there is an > index file .SHX which points to a .SHP file which has variable length records. > > There are a few problems that I can see. Please verify if any of these are > correct or not. > 1. Deleting an old object. I think this can be handled by setting the > shapetype to a NULL shape. > > 2. Increasing the number of vertices of a shape, and hence increasing the > record size. I think the best way to handle this is to remove the old shape > by setting its shapetype to NULL, and to add a new shape to the end of the > .SHP file. The pointer in the .SHX file will now have to be redirected to the > end of the .SHP file. This now means that the order of the .SHP file and the > .SHX file will not match, which will reduce query speeds, so periodically the > datafiles would need to be rebuilt. > > 3. There is an issue with the .SHP file and .SHX file becoming out of sync. > Basically, when a shape is updated, first the .SHP file will need to be > updated, and some time later the .SHX file will be updated. There is a window > of opportunity where the files will be out of sync. I was planning to address > this by either putting in a lock file, or changing read/write permissions to > lock the files while the database is out of sync. > This means that some reads of the database will fail because the database is > updating. > > 4. I'm not sure what the best way is to link into a SQL database. If the > shapefile is only added to, then the best way to reference an object is by > using the index in the .SHX file. However, if you delete an object, should > you rebuild the .SHX file? This will keep the index file from blowing out, > but all the indexes will change and hence the SQL database will reference the > wrong indices. vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v How about a unique key stored in the dbf file used to join to the SQL database? This would allow for many shapefiles joining to a single SQL table (might be useful if the data is tiled.) vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v > > Happy for any advice. > > Cameron. > From SullivanJ at nima.mil Wed Oct 13 05:51:32 1999 From: SullivanJ at nima.mil (Sullivan, James R.) Date: Wed, 13 Oct 1999 08:51:32 -0400 Subject: Updating Shapefiles, and data integrity Message-ID: <29E2BCE114FBD1118EE000805FBEA41380B8F1@WNYX2> Believe a better approach would be to develop a Mapserver interface to Oracle Spatial or ESRI SDE. Let the database do all the locking, etc. This would answer the mail on a number of other issues, too. Both have open C api that can be downloaded via the net. Jim Sullivan NIMA / TES -----Original Message----- From: Stephen Lime [SMTP:steve.lime at dnr.state.mn.us] Sent: Tuesday, October 12, 1999 5:37 PM To: camerons at cat.org.au; bfraser at geoanalytic.ab.ca; mapserver-users at lists.gis.umn.edu Subject: Re: Updating Shapefiles, and data integrity The more I think about this, the more I understand why I never attempted it. Locking is a real pain in the CGI world. When do you lock, when a record is requested or when edits are submitted? If the latter then there is a chance more than one person could request the same shape. I don't think that on-the-fly edits are possible robustly. Somehow I think edits need to be cached and commited "behind the scenes". It's essential the shp, shx and dbf records remain in sync. What about something like this: Assuming the there is a mechanism to request a shape and attributes (and a checkout time) and make changes. A user now sends back some edits. This causes a record to be written to a "pending" database. What actually gets saved are things like source shapefile, feature id (-1 for new), timestamp, etc. The actually edits get saved in some format (shapefile) as a file whose name can be reconstructed from elements in the pending database. Now, periodically a process could go through and commit the edits in the pending database to production (not web accessible) versions. When this is finished the updated stuff could be swapped in for the old stuff and the pending database purged (in part). The commiting of the shapes would essentially involve rebuilding the shapefile from the user edits and the production version (i.e. pick the edited version if it exists). Put a lock in place while versions are being swapped and remove it when done, probably only a few seconds. You could even maintain a history by saving previous versions for some period of time or retiring shapes to some external format (shapefile). As requests for shapes come in a quick check of the pending database could be used to identify re-edits. If a timestamp is set when a shape is requested then it could be compared against edits in the pending database to identify possible problems. If a user requests an edited shape just send the pending edits as if they were part of the current shapefile. New shapes are just added to the pending database and make their way into the main database as part of the update process. Sounds complicated but really is only 2 processes, 1 database and a bunch of cached edits. Timestamps can help alleviate simultaneous edits and a the worst thing a user would see would be a message like "The record you're submitting has changed since you requested it, cannot process the edit. Would you like to work from the edited version?". Again, without some sort of a persistant connection I doubt that real-time editing is possible. One could bump the commit time up to a few minutes or even seconds though so it would certainly seem real-time. (Cameron, this approach would involve no editing of Frank's shapelib at all since all you're doing is reading and writing individual records. The effort goes into getting all the communication working right. Could even be a perl script with system calls to the shapelib utils for creating files and adding info.) Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us >>> "bfraser" 10/12 11:00 AM >>> see my comments below... Brent Fraser ----- Original Message ----- From: Cameron Shorter To: mapserver Sent: Sunday, October 10, 1999 4:14 AM Subject: Updating Shapefiles, and data integrity > > > -------- Original Message -------- > Subject: Re: request for comments... > Date: Sun, 10 Oct 1999 19:16:24 +1000 > From: Cameron Shorter > Reply-To: camerons at cat.org.au > To: Stephen Lime > References: > > > > Stephen Lime wrote: > > > > Maintaining data integrity is going to be a big issue. I was at our state GIS conference and got to chat with Jack Dangermond from ESRI about the MapServer and their new ArcIMS product. Seems they're having trouble with this editing stuff. Shapefiles just aren't a transactional environment so unless you can assure yourself of single user access there's always the potential for multiple concurrent edits. Then there's the issue of quality control. I think the solution needs to offer immediate update and delayed update. ArcIMS, as I understand it, caches updates until an operator on the server site commits the edits to the main database. This operator could be a cron process I suppose that could handle locking while > > edits are processed. I think this may be a good approach as you could do some simple transaction management- review, edit and delete, once the initial work was done. Edits could be stored in a shapefile along with attributes and enough additional information to commit the shape - source shapefile, shape (or is a new one), type of edit (replace, attribute change) etc. > > > > Anyway, just my thoughts... > > > > Steve > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v Enterprise-wide editing can require a lot of infrastructure to support it. A large-scale implementation might include (this is only one scenario): o a data repository / warehouse / database o project workspaces for editing o a "view-only" copy of the data Typical workflows would include: 1. Edit: operator identifies features in warehouse for editing, locks them, extracts them to the project workspace. The features are edited, possibly reviewed, then checked back into the warehouse. This is sometimes known as a "long transaction" Some things that may be important: 1. feature level locking (as apposed to file locking) to prevent simultaneous editing 2. feature lineage tracking: timestamps, feature "retirement" instead of deletion 3. theme security: certain departments can edit only specific themes 2. Copy: at a pre-determined schedule, the warehouse is copied to the "View-only" database. This may include re-formatting, indexing and distributing the data to get better performance for viewing. Depending on the edits, the copy could be once a day, once a month, etc. The good thing about this approach is that the user (viewer/querier) has a stable data set to operate on. The bad thing is it might not be up to date. 3. Viewing: the data is queried and rendered for thick and thin client apps. Of course all this might be unnecessary if you only have occasional edits and a few viewers.... vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v > I'm glad to hear I'm not the only one having problems with updating > shapefiles. :) > > >From looking at the shapefile definition paper, you can see that there is an > index file .SHX which points to a .SHP file which has variable length records. > > There are a few problems that I can see. Please verify if any of these are > correct or not. > 1. Deleting an old object. I think this can be handled by setting the > shapetype to a NULL shape. > > 2. Increasing the number of vertices of a shape, and hence increasing the > record size. I think the best way to handle this is to remove the old shape > by setting its shapetype to NULL, and to add a new shape to the end of the > .SHP file. The pointer in the .SHX file will now have to be redirected to the > end of the .SHP file. This now means that the order of the .SHP file and the > .SHX file will not match, which will reduce query speeds, so periodically the > datafiles would need to be rebuilt. > > 3. There is an issue with the .SHP file and .SHX file becoming out of sync. > Basically, when a shape is updated, first the .SHP file will need to be > updated, and some time later the .SHX file will be updated. There is a window > of opportunity where the files will be out of sync. I was planning to address > this by either putting in a lock file, or changing read/write permissions to > lock the files while the database is out of sync. > This means that some reads of the database will fail because the database is > updating. > > 4. I'm not sure what the best way is to link into a SQL database. If the > shapefile is only added to, then the best way to reference an object is by > using the index in the .SHX file. However, if you delete an object, should > you rebuild the .SHX file? This will keep the index file from blowing out, > but all the indexes will change and hence the SQL database will reference the > wrong indices. vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v How about a unique key stored in the dbf file used to join to the SQL database? This would allow for many shapefiles joining to a single SQL table (might be useful if the data is tiled.) vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv v > > Happy for any advice. > > Cameron. > From david.fawcett at moea.state.mn.us Wed Oct 13 06:19:18 1999 From: david.fawcett at moea.state.mn.us (Fawcett, David) Date: Wed, 13 Oct 1999 08:19:18 -0500 Subject: FW: Updating Shapefiles, and data integrity Message-ID: <3E2112BBDA46D311824C00805F9FE4FF40B0DE@pca-ex03.pca.state.mn.us> This may be fine as an "extension", but if it became integral, it would certainly change the product from a free program to a pretty expensive one. Even if a non-commercial solution to this issue is a little kludgy and slower than real-time, it may serve most people's needs, and will avoid spendy Oracle or SDE licenses. David Fawcett Minnesota Office of Environmental Assistance > ---------- > From: Sullivan, James R.[SMTP:SullivanJ at nima.mil] > Sent: Wednesday, October 13, 1999 7:51 AM > To: 'Stephen Lime'; camerons at cat.org.au; bfraser at geoanalytic.ab.ca; mapserver-users at lists.gis.umn.edu > Subject: RE: Updating Shapefiles, and data integrity > > Believe a better approach would be to develop a Mapserver interface to > Oracle Spatial or ESRI SDE. Let the database do all the locking, etc. > This would answer the mail on a number of other issues, too. Both have open > C api that can be downloaded via the net. > > > Jim Sullivan > NIMA / TES > > -----Original Message----- > From: Stephen Lime [SMTP:steve.lime at dnr.state.mn.us] > Sent: Tuesday, October 12, 1999 5:37 PM > To: camerons at cat.org.au; bfraser at geoanalytic.ab.ca; > mapserver-users at lists.gis.umn.edu > Subject: Re: Updating Shapefiles, and data integrity > > The more I think about this, the more I understand why I never > attempted it. > Locking is a real pain in the CGI world. When do you lock, when a > record > is requested or when edits are submitted? If the latter then there > is a chance > more than one person could request the same shape. I don't think > that > on-the-fly edits are possible robustly. Somehow I think edits need > to be cached > and commited "behind the scenes". It's essential the shp, shx and > dbf records > remain in sync. What about something like this: > > Assuming the there is a mechanism to request a shape and attributes > (and a checkout > time) and make changes. A user now sends back some edits. This > causes a record to > be written to a "pending" database. What actually gets saved are > things like source > shapefile, feature id (-1 for new), timestamp, etc. The actually > edits get saved in some format > (shapefile) as a file whose name can be reconstructed from elements > in the pending database. > Now, periodically a process could go through and commit the edits in > the pending database > to production (not web accessible) versions. When this is finished > the updated stuff > could be swapped in for the old stuff and the pending database > purged (in part). The > commiting of the shapes would essentially involve rebuilding the > shapefile from the user > edits and the production version (i.e. pick the edited version if it > exists). Put a lock in > place while versions are being swapped and remove it when done, > probably only a > few seconds. You could even maintain a history by saving previous > versions for > some period of time or retiring shapes to some external format > (shapefile). > > As requests for shapes come in a quick check of the pending database > could be used > to identify re-edits. If a timestamp is set when a shape is > requested then it could be > compared against edits in the pending database to identify possible > problems. If a user > requests an edited shape just send the pending edits as if they were > part of the current > shapefile. New shapes are just added to the pending database and > make their way > into the main database as part of the update process. > > Sounds complicated but really is only 2 processes, 1 database and a > bunch of cached > edits. Timestamps can help alleviate simultaneous edits and a the > worst thing a user > would see would be a message like "The record you're submitting has > changed since > you requested it, cannot process the edit. Would you like to work > from the edited version?". > > Again, without some sort of a persistant connection I doubt that> > real-time editing is possible. > One could bump the commit time up to a few minutes or even seconds > though so it would > certainly seem real-time. > > (Cameron, this approach would involve no editing of Frank's shapelib > at all since all you're > doing is reading and writing individual records. The effort goes > into getting all the communication > working right. Could even be a perl script with system calls to the > shapelib utils for creating > files and adding info.) > > Steve > > Stephen Lime > Internet Applications Analyst > MIS Bureau - MN DNR > > (651) 297-2937 > steve.lime at dnr.state.mn.us > > >>> "bfraser" 10/12 11:00 AM >>> > see my comments below... > > Brent Fraser > > > ----- Original Message ----- > From: Cameron Shorter > To: mapserver > Sent: Sunday, October 10, 1999 4:14 AM > Subject: Updating Shapefiles, and data integrity > > > > > > > > -------- Original Message -------- > > Subject: Re: request for comments... > > Date: Sun, 10 Oct 1999 19:16:24 +1000 > > From: Cameron Shorter > > Reply-To: camerons at cat.org.au > > To: Stephen Lime > > References: > > > > > > > > Stephen Lime wrote: > > > > > > Maintaining data integrity is going to be a big issue. I was at > our > state GIS conference and got to chat with Jack Dangermond from ESRI > about > the MapServer and their new ArcIMS product. Seems they're having > trouble > with this editing stuff. Shapefiles just aren't a transactional > environment > so unless you can assure yourself of single user access there's > always the > potential for multiple concurrent edits. Then there's the issue of > quality > control. I think the solution needs to offer immediate update and > delayed > update. ArcIMS, as I understand it, caches updates until an operator > on the > server site commits the edits to the main database. This operator > could be a > cron process I suppose that could handle locking while > > > edits are processed. I think this may be a good approach as you > could do > some simple transaction management- review, edit and delete, once > the > initial work was done. Edits could be stored in a shapefile along > with > attributes and enough additional information to commit the shape - > source > shapefile, shape (or is a new one), type of edit (replace, attribute > change) > etc. > > > > > > Anyway, just my thoughts... > > > > > > Steve > > > > > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv > v > > Enterprise-wide editing can require a lot of infrastructure to > support it. > A large-scale > implementation might include (this is only one scenario): > > o a data repository / warehouse / database > o project workspaces for editing > o a "view-only" copy of the data > > Typical workflows would include: > > 1. Edit: operator identifies features in warehouse for editing, > locks them, > extracts them > to the project workspace. The features are edited, possibly > reviewed, > then checked > back into the warehouse. This is sometimes known as a "long > transaction" > Some things that may be important: > 1. feature level locking (as apposed to file locking) to > prevent > simultaneous editing > 2. feature lineage tracking: timestamps, feature > "retirement" > instead of deletion > 3. theme security: certain departments can edit only > specific themes > > 2. Copy: at a pre-determined schedule, the warehouse is copied to > the > "View-only" > database. This may include re-formatting, indexing and > distributing the > data to get better > performance for viewing. Depending on the edits, the copy could > be once > a day, > once a month, etc. The good thing about this approach is that> > the user > (viewer/querier) has a stable data set to operate on. The bad > thing is > it might not be > up to date. > > 3. Viewing: the data is queried and rendered for thick and thin > client apps. > > Of course all this might be unnecessary if you only have occasional > edits > and a few > viewers.... > > > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv > v > > > > I'm glad to hear I'm not the only one having problems with > updating > > shapefiles. :) > > > > >From looking at the shapefile definition paper, you can see that > there is > an > > index file .SHX which points to a .SHP file which has variable > length > records. > > > > There are a few problems that I can see. Please verify if any of > these > are > > correct or not. > > 1. Deleting an old object. I think this can be handled by setting > the > > shapetype to a NULL shape. > > > > 2. Increasing the number of vertices of a shape, and hence > increasing the > > record size. I think the best way to handle this is to remove the > old > shape > > by setting its shapetype to NULL, and to add a new shape to the > end of the > > .SHP file. The pointer in the .SHX file will now have to be > redirected to > the > > end of the .SHP file. This now means that the order of the .SHP > file and > the > > .SHX file will not match, which will reduce query speeds, so > periodically > the > > datafiles would need to be rebuilt. > > > > 3. There is an issue with the .SHP file and .SHX file becoming out > of > sync. > > Basically, when a shape is updated, first the .SHP file will need > to be > > updated, and some time later the .SHX file will be updated. There > is a > window > > of opportunity where the files will be out of sync. I was > planning to > address > > this by either putting in a lock file, or changing read/write > permissions > to > > lock the files while the database is out of sync. > > This means that some reads of the database will fail because the > database > is > > updating. > > > > 4. I'm not sure what the best way is to link into a SQL database. > If the > > shapefile is only added to, then the best way to reference an > object is by > > using the index in the .SHX file. However, if you delete an > object, > should > > you rebuild the .SHX file? This will keep the index file from > blowing > out, > > but all the indexes will change and hence the SQL database will > reference > the > > wrong indices. > > > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv > v > How about a unique key stored in the dbf file used to join to the > SQL > database? > > This would allow for many shapefiles joining to a single SQL table > (might be > useful if the data is tiled.) > > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv > v > > > > > > Happy for any advice. > > > > Cameron. > > > From pgallen at randomlogic.com Wed Oct 13 13:09:18 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Wed, 13 Oct 1999 13:09:18 -0700 Subject: FW: Updating Shapefiles, and data integrity References: <3E2112BBDA46D311824C00805F9FE4FF40B0DE@pca-ex03.pca.state.mn.us> Message-ID: <3804E6EE.2D7CC928@randomlogic.com> "Fawcett, David" wrote: > This may be fine as an "extension", but if it became integral, it would certainly change the product from a free program to a pretty expensive one. > > Even if a non-commercial solution to this issue is a little kludgy and slower than real-time, it may serve most people's needs, and will avoid spendy Oracle or SDE licenses. > [BIG_HUGE_SNIP] I know little about database software, but wouldn't something like Postgres SQL (postgresql) or MySQL work for this? Also, Oracle 8i and IBM's DB2 are free for personal use and development under Linux. Would either of those work? My brother (not on this list, but maybe he should be) said it sounds to him like what is needed is a relational database to handle the three files - .dbf, .shp, .shx. He also said the only database software he knew of that handles record locking is Paradox, where the others use file locking. PGA From pgallen at randomlogic.com Wed Oct 13 13:35:03 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Wed, 13 Oct 1999 13:35:03 -0700 Subject: Making .dbf, .shp, and .shx files Message-ID: <3804ECF7.4E6DB9A6@randomlogic.com> At the risk of looking stupid... A couple people told me I could make shape files containing the shapes of all the county maps I have so that I can tile them into one larger map. This makes perfect sense to me. Since every county map already has a county shape file, I already have the shape data. Since I am quite a novice at this: How do I combine all the various shape files into a single shape file? How do I combine the various .shx and .dbf that accompany these shape files into corresponding files to go along with the single county shape file? What would really be nice is: 1. Have a map of the entire continental US with each state outlined, and a couple smaller maps containing the US territories (American Samoa, the Pacific Territories, Alaska, etc.). 2. The user clicks on a state/territory and is then given another map of that state with the various counties outlines. 3. The user can then zoom/pan/query that map to find what he/she needs. I've read in to documentation that it's possible to set a maximum scale so that the interface can change from one map to another - zoom out too far in a county map, and the entire state is displayed, or maybe the surrounding counties are tiled to make a slightly larger (more coverage) map. I assume you can get the same result in the other direction? (Zoom in too far in the state map and you get a county or several counties.) What if you pan off the edge of a map? Something else I'd like to do in the immediate future: Plot my own data on a map. The data is retrieved via text email messages. The data includes LAT/LONG position and various pieces of information regarding the status of a field unit. I'd like to be able to take this type of data from an arbitrary number of units, concatenate it into a single set of ESRI files, and display/query it just like I'm doing with current map data. How difficult is this and are the tools for it already included/supplied? (remember, I'm a novice at this and only have about 16hrs. total experience with MapServer - the first 8 involved making the first map of San Diego :) BTW, I've updated my San Diego map and added Cook County, IL to my test web site with enhanced 1997-98 data from the Census. (My wife used to live near Chicago :) Again the URL is: 24.5.14.144 or http://cx570538-a.elcjn1.sdca.home.com. PGA From mjacquin at geosys-inc.com Wed Oct 13 16:37:26 1999 From: mjacquin at geosys-inc.com (Marc JACQUIN - GEOSYS Inc - Minneapolis) Date: Wed, 13 Oct 1999 16:37:26 -0700 Subject: Data integrity in shape/dbf files Message-ID: <380517B6.7422F1A1@geosys-inc.com> Hi everyone, Seems to be a great deal to be able to have concurrent updates on shape files (and dbf). In an application only using point shapes, I tried to implement record locking on DBF. I am only using MapServer functions calls to generate GIF files (from a map file) and embed it into my own CGI. Seems to work on Win32 with lock functions. On Unix there is an equivalent through fnctl. I added those functions to the shapelib. Of course, it is only valid for attributes. Must be careful about dead-locking. Due to Web browsing, we cannot assure that the end user has an updated view of the database. There is no way with CGI to know if a page needs to be reloaded, but when an update is done the CGI can reload the main page after the post, so the end user sees the changes he did. Changing shapes cannot really be done with the ismap capabilities. Using some Java is required. My idea is that shape files and objects can be stored into a DBMS as BLOB (like SDE does I guess). Marc -------------- next part -------------- A non-text attachment was scrubbed... Name: mjacquin.vcf Type: text/x-vcard Size: 416 bytes Desc: Card for Marc JACQUIN - GEOSYS Inc - Minneapolis URL: From pgallen at randomlogic.com Wed Oct 13 14:46:00 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Wed, 13 Oct 1999 14:46:00 -0700 Subject: Colr look up table Message-ID: <3804FD98.C9EFAEB1@randomlogic.com> On the ForNet site I was reading some old MapServer documentation (v2.3) about making a color table. Does the latest version of MapServer support this? I have a file as outlined in the afore mentioned documentation and I have used the old printcolors utility to create a GIF image of it. Now I'm wondering if/how I can use the color file. Thanks, PGA From Ross.Searle at dnr.qld.gov.au Thu Oct 14 00:16:41 1999 From: Ross.Searle at dnr.qld.gov.au (Searle Ross) Date: Thu, 14 Oct 1999 17:16:41 +1000 Subject: No subject Message-ID: Hi Anyone got any ideas about what might be causing Version 3.22 to return the following error from the web server [Thu Oct 14 16:53:23 1999] HTTPd: malformed header from script /usr/local/http/cgi-bin/mapserv3.22 [Thu Oct 14 16:53:23 1999] HTTPd: send aborted for 161.143.17.153, URL: /cgi-bin/mapserv3.22 I have version 3.1 working fine. my ini file is as follows # Where are fonts and symbols files located SYMBOL_PATH=/data4/WWW/mapserver/symbols # Absolute path to writable directory where images are to be written. This # directory needs to be: # (1) writable by the user httpd is running as # (2) accessible via the web IMAGE_PATH=/data4/WWW/tmp # Path relative to document root of the web server for the writeable directory. IMAGE_VIRTUAL_PATH=tmp # Contact information provided if errors occur. CONTACT_EMAIL=ross.searle at dnr.qld.gov.au # Where are the log files to be created. Comment out if you don't want them. # You must create the directory and make it writable by the user the web server # runs as. Alternatively, create a file called "access.log" there and change # ownership or permissions accordingly. LOG_PATH=/data4/WWW/mapserver # File extention of template html files. Should be a regular expression. This # usually doesn't need to be changed. #TEMPLATE_EXTENSION=\.html # File extention of map files. Should be a regular expression. This usually # doesn't need to be changed. #MAP_EXTENSION=\.map Ross Searle Natural Resource Information Management Officer Department of Natural Resources PO Box 1143 Bundaberg QLD 4670. Australia Ph : 0741 537 888 Fax : 0741 537 823 From pgallen at randomlogic.com Thu Oct 14 00:53:37 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Thu, 14 Oct 1999 00:53:37 -0700 Subject: No subject References: Message-ID: <38058C01.441EDFD3@randomlogic.com> Searle Ross wrote: > Hi > > Anyone got any ideas about what might be causing Version 3.22 to return the > following error from the web server > > [Thu Oct 14 16:53:23 1999] HTTPd: malformed header from script > /usr/local/http/cgi-bin/mapserv3.22 > [Thu Oct 14 16:53:23 1999] HTTPd: send aborted for 161.143.17.153, URL: > /cgi-bin/mapserv3.22 > > I have version 3.1 working fine. > 3.22? Didn't know this was out. I checked the site tonight and saw the same 3.21 10/01/99 listed. Guess I'll have to update (once there's a clear answer to your problem. I'm using 3.20 now) PGA From pgallen at randomlogic.com Thu Oct 14 05:14:32 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Thu, 14 Oct 1999 05:14:32 -0700 Subject: Once again I've partially answered my own questions Message-ID: <3805C928.4DB57756@randomlogic.com> By reading a little about the Shapelib API and writing a small application, I have been able to concatenate shapefile data painlessly. I also know how I can convert the data from our field units into a format that can be used by MapServer. I'd still like to know if/how a color table can be used though. The only missing piece now seems to be a decent TSP (Travelling Salesman Problem) program and vehicle routing program. So far what I've seen on the web is not really what we need: The VRP data I've seen deals with forms of the TSP with Time Windows, when all I want is an algorithm to tell me how to get from point A to point B within a city, not from city to city. So far the quick and easy solution eludes me, but if I have to write my own, so be it. :) Thanks to all those who've given me insight into the workings of MapServer, shapefiles, and Shapelib. PGA From mapadm at polsl.gliwice.pl Thu Oct 14 05:45:53 1999 From: mapadm at polsl.gliwice.pl (Grzegorz Myrda) Date: Thu, 14 Oct 1999 14:45:53 +0200 Subject: Once again I've partially answered my own questions Message-ID: <004101bf1642$114c7820$0900000a@pc-9.ispik.pl> -----Original Message----- From: Paul G. Allen To: MapServer Users List Date: 14 pa?dziernika 1999 14:16 Subject: Once again I've partially answered my own questions >MapServer. I'd still like to know if/how a color table can be used though. There is no color table in current version of MapServer. Instead you use RGB values directly. Grzegorz From mjacquin at geosys-inc.com Thu Oct 14 10:05:19 1999 From: mjacquin at geosys-inc.com (Marc JACQUIN - GEOSYS Inc - Minneapolis) Date: Thu, 14 Oct 1999 10:05:19 -0700 Subject: [MAPSERVER] Message headers Message-ID: <38060D4E.1A4F8C8F@geosys-inc.com> Could we have a common tag inside message headers so we recognize a mail easily ? It would be easier to archive and filter. Marc -------------- next part -------------- A non-text attachment was scrubbed... Name: mjacquin.vcf Type: text/x-vcard Size: 416 bytes Desc: Card for Marc JACQUIN - GEOSYS Inc - Minneapolis URL: From TBanister at SpaceImaging.com Thu Oct 14 09:01:55 1999 From: TBanister at SpaceImaging.com (Banister Trevor) Date: Thu, 14 Oct 1999 10:01:55 -0600 Subject: [MAPSERVER] Message headers Message-ID: The common tag is already available. The To: line :-) Filter on the expression mapserver-users at lists.gis.umn.edu I'm using this to drop all the mapserver traffic into it's own folder. > ---------- > From: Marc JACQUIN - GEOSYS Inc - > Minneapolis[SMTP:mjacquin at geosys-inc.com] > Sent: Thursday, October 14, 1999 11:05 AM > To: MapServer Users List > Subject: [MAPSERVER] Message headers > > <> > Could we have a common tag inside message headers so we recognize a mail > easily ? It would be easier to archive and filter. > > Marc > > > From steve.lime at dnr.state.mn.us Thu Oct 14 11:10:57 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Thu, 14 Oct 1999 13:10:57 -0500 Subject: Colr look up table Message-ID: I assume you're refering to lookup tables based on some attribute value. Color tables, symbol tables etc. are now handled as classes. Like the old color table each class has an (optional) expression associated with it. Instead of just being able to control color, with classes you can control size, color, outlinecolor, labels and so on... Here's an example with 2 classes : # what item to I want to classify on CLASSITEM foo # now the class definitions CLASS NAME class1 EXPRESSION "0" # note: this is a regular expression COLOR 255 0 0 END CLASS NAME class2 EXPRESSION "1" COLOR 0 0 255 END Assuming item "foo" contains either 0 or 1, 0's would be drawn in red and 1's in green. Class names are used for legend building, ommit them if you don't want a particular class to show up in a legend. Features that don't match any class expression are not drawn. If all features are to be drawn the same, then define only 1 class with NO expression defined. Classes are a simple way to create thematic maps based on regular expressions. Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us >>> "Paul G. Allen" 10/13 4:46 PM >>> On the ForNet site I was reading some old MapServer documentation (v2.3) about making a color table. Does the latest version of MapServer support this? I have a file as outlined in the afore mentioned documentation and I have used the old printcolors utility to create a GIF image of it. Now I'm wondering if/how I can use the color file. Thanks, PGA From cshorter at optusnet.com.au Thu Oct 14 13:33:32 1999 From: cshorter at optusnet.com.au (Cameron Shorter) Date: Fri, 15 Oct 1999 06:33:32 +1000 Subject: [MAPSERVER] Message headers References: <38060D4E.1A4F8C8F@geosys-inc.com> Message-ID: <38063E1C.199BFE7D@optusnet.com.au> Yes, I agree I would find it handy. If you are using majordomo, then in the mapserver.config file set the following: subject_prefix = [mapserver] Marc JACQUIN - GEOSYS Inc - Minneapolis wrote: > > Could we have a common tag inside message headers so we recognize a mail > easily ? It would be easier to archive and filter. > > Marc From piero at innova.it Fri Oct 15 01:45:45 1999 From: piero at innova.it (Pierluigi Vittori) Date: Fri, 15 Oct 1999 10:45:45 +0200 Subject: Shortest path problem Message-ID: <99101511024500.00614@buzz.myhouse.net> Hi all! I would like to have a new function in mapserv (or as a separate cgi application) for finding the shortest path between two given points in a city map. Does anyone have suggestions - either theoretical or practical - on a possible approach to this matter? For example, is Dijkstra's algorithm applicable and suitable to this goal or are there better ways to accomplish it? Thanks in advance for your opinions. Piero From eserte at cs.tu-berlin.de Fri Oct 15 14:15:12 1999 From: eserte at cs.tu-berlin.de (Slaven Rezic) Date: 15 Oct 1999 23:15:12 +0200 Subject: [Fwd: Shortest path problem] In-Reply-To: Cameron Shorter's message of Fri, 15 Oct 1999 20:48:04 +1000 References: <38070664.A56BEE78@optusnet.com.au> Message-ID: <87hfjsjpgf.fsf@cabulja.herceg.de> Hello Cameron, hello Pierluigi, I use the algorithm A* to get the shortest path between two places. I don't know what's the format of the mapserver data, but I think it should be easy to make it usable by my perl module. The module is part of a larger system. The sources can be found under http://pub.cs.tu-berlin.de/src/BBBike Regards, Slaven -- use Tk;$c=tkinit->Canvas(-he,20)->grid;$x=5;map{s/\n//g;map{$c->create('line'=> map{$a=-43+ord;($x+($a>>3)*2=>5+($a&7)*2)}split//)}split/!/;$x+=12}split/_/=>'K PI1_+09IPK_K;-OA1_+K!;A__1;Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+ KN._K+1Q!.F_1+KN.Q_+1Q__+1!KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q_';MainLoop From piero at innova.it Sun Oct 17 02:14:24 1999 From: piero at innova.it (Pierluigi Vittori) Date: Sun, 17 Oct 1999 11:14:24 +0200 Subject: [Fwd: Shortest path problem] References: <87hfjsjpgf.fsf@cabulja.herceg.de> Message-ID: <99101711212500.00444@buzz.myhouse.net> On ven, 15 ott 1999, Slaven Rezic wrote: > Hello Cameron, hello Pierluigi, > > I use the algorithm A* to get the shortest path between two places. I > don't know what's the format of the mapserver data, but I think it > should be easy to make it usable by my perl module. The module is part > of a larger system. The sources can be found under > http://pub.cs.tu-berlin.de/src/BBBike Hi Slaven! I have just taken a look at the address you sent and things look VERY interesting! I am going to study it more carefully but for now I just wanted to say thank you very much for your help. Regards, Pierluigi From pgallen at randomlogic.com Mon Oct 18 23:13:51 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Mon, 18 Oct 1999 23:13:51 -0700 Subject: Map Test Project update Message-ID: <380C0C1F.9E468A92@randomlogic.com> I have written a utility specifically designed to concatinate shapefiles using the Shapelib library called combine. I also had a fellow Linux user write a Perl script to parse a directory tree, retrieve all files matching a certain pattern, and run them through the combine program. I've used these two utilities to combine all county data for two states, and make the states of Illinois and Pennsylvania on my test web site (http://24.5.14.144) each into their own shapefile. These two files initially only have county polygon data, but will later have major roads and water polygon data. Also, since I mucked up the conversion of the original data from TIGER/Line format to ESRI shapefile format, I have to do it again to get the actual county names in the database. (ooppss! :) It looks as though MapServer, combined with Shapelib, a little Perl, some CGI, and a yet to be found VRP will give me everything we need for our application. Now if only I had more HDD storage for all this data! :) Writing the utility has given me a very good understanding of shapefiles and the Shapelib library. In fact, I found and fixed a couple of bugs in Shapelib that bit me more than once. I'll be posting the utilities somewhere and making the Shapelib author aware of them as well. Anyone know where I can get an ESRI shapefile of Brazil that includes roads, landmarks, etc.? PGA From bfraser at geoanalytic.com Tue Oct 19 07:08:54 1999 From: bfraser at geoanalytic.com (Brent Fraser) Date: Tue, 19 Oct 1999 08:08:54 -0600 Subject: Map Test Project update References: <380C0C1F.9E468A92@randomlogic.com> Message-ID: <000e01bf1a3b$7a43ce80$390002c0@servo> There is some E00 format data at 1:1m at the GIS Data Depot (probably from the DCW). http://www.gisdatadepot.com/data/catalog/BR/sublist.html You'll have to run ESRI's Import71 utility (comes with ArcView) to convert it to shapefiles... Brent ----- Original Message ----- From: Paul G. Allen To: MapServer Users List Sent: Tuesday, October 19, 1999 12:13 AM Subject: Map Test Project update > I have written a utility specifically designed to concatinate shapefiles using > the Shapelib library called combine. I also had a fellow Linux user write a Perl > script to parse a directory tree, retrieve all files matching a certain pattern, > and run them through the combine program. I've used these two utilities to > combine all county data for two states, and make the states of Illinois and > Pennsylvania on my test web site (http://24.5.14.144) each into their own > shapefile. These two files initially only have county polygon data, but will > later have major roads and water polygon data. Also, since I mucked up the > conversion of the original data from TIGER/Line format to ESRI shapefile format, > I have to do it again to get the actual county names in the database. (ooppss! > :) > > It looks as though MapServer, combined with Shapelib, a little Perl, some CGI, > and a yet to be found VRP will give me everything we need for our application. > Now if only I had more HDD storage for all this data! :) > > Writing the utility has given me a very good understanding of shapefiles and the > Shapelib library. In fact, I found and fixed a couple of bugs in Shapelib that > bit me more than once. I'll be posting the utilities somewhere and making the > Shapelib author aware of them as well. > > Anyone know where I can get an ESRI shapefile of Brazil that includes roads, > landmarks, etc.? > > PGA > From pgallen at randomlogic.com Tue Oct 19 11:01:56 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Tue, 19 Oct 1999 11:01:56 -0700 Subject: Map Test Project update References: <380C0C1F.9E468A92@randomlogic.com> <000e01bf1a3b$7a43ce80$390002c0@servo> Message-ID: <380CB214.EF0A1E80@randomlogic.com> Brent Fraser wrote: > There is some E00 format data at 1:1m at > the GIS Data Depot (probably from the DCW). > > http://www.gisdatadepot.com/data/catalog/BR/sublist.html > > You'll have to run ESRI's Import71 utility (comes with > ArcView) to convert it to shapefiles... > Now if only I had ArcView... PGA From sphillip at mail.esrp.org Tue Oct 19 12:01:20 1999 From: sphillip at mail.esrp.org (Scott Phillips) Date: Tue, 19 Oct 1999 12:01:20 PDT Subject: Map Test Project update (e00 files) Message-ID: <199910191901.MAA15355@mail.esrp.org> Re: utilities for e00 files. I haven't used it myself, but I noticed that there is a utility called e002gen available from the US Bureau of Land Management. (ftp://ftp.blm.gov/pub/gis/) to convert E00 files to Generate files (ASCII text files that store coordinates) The index for the directory notes that the utility only works on line files. It looks like it is available as both source code (e002gen.zip) and as a DOS executeable (e002gen.exe). This site also has a copy of shapelib distribution that includes a program called gen2shp to create a shape file from a generate file. (ftp://ftp.blm.gov/pub/gis/shape/) Note also that the Import71 utility (windows app) can be downloaded for free from ESRI without buying ArcView. However, this utility does not create shape files, it creates ARC/INFO coverages that are used with the more expensive ARC/INFO GIS software, but can be read by ArcView too. (http://www.esri.com/company/free.html) If you have GRASS, you could import e00 files and probably export the data into somthing you could turn into a shape file using shapelib. Regards, Scott Phillips sphillip at esrp.org > > Brent Fraser wrote: > > > There is some E00 format data at 1:1m at > > the GIS Data Depot (probably from the DCW). > > > > http://www.gisdatadepot.com/data/catalog/BR/sublist.html > > > > You'll have to run ESRI's Import71 utility (comes with > > ArcView) to convert it to shapefiles... > > > > Now if only I had ArcView... > > PGA > > > > From piero at innova.it Tue Oct 19 11:55:34 1999 From: piero at innova.it (Pierluigi Vittori) Date: Tue, 19 Oct 1999 20:55:34 +0200 Subject: Shortest path problem References: <87hfjsjpgf.fsf@cabulja.herceg.de> Message-ID: <99101920595400.00401@buzz.myhouse.net> On ven, 15 ott 1999, Slaven Rezic wrote: > Hello Cameron, hello Pierluigi, > > I use the algorithm A* to get the shortest path between two places. I > don't know what's the format of the mapserver data, but I think it > should be easy to make it usable by my perl module. The module is part > of a larger system. The sources can be found under > http://pub.cs.tu-berlin.de/src/BBBike Hello Slaven! can you indicate any papers or other kind of references to turn to for a theoretical background on such an issue? I appreciate your help very much. Thanks. Regards, Pierluigi From nhv at cape.com Tue Oct 19 12:35:10 1999 From: nhv at cape.com (Norman Vine) Date: Tue, 19 Oct 1999 15:35:10 -0400 Subject: Map Test Project update (e00 files) In-Reply-To: <199910191901.MAA15355@mail.esrp.org> Message-ID: <000001bf1a69$480c09e0$3d37ba8c@nhv> > >Re: utilities for e00 files. > You might find the Grass import e00 'C' code useful http://www.geog.uni-hannover.de/grass/projects/m.in.e00/welcome.html Norman Vine From eserte at cs.tu-berlin.de Tue Oct 19 16:40:00 1999 From: eserte at cs.tu-berlin.de (Slaven Rezic) Date: 20 Oct 1999 01:40:00 +0200 Subject: Shortest path problem In-Reply-To: Pierluigi Vittori's message of Tue, 19 Oct 1999 20:55:34 +0200 References: <87hfjsjpgf.fsf@cabulja.herceg.de> <99101920595400.00401@buzz.myhouse.net> Message-ID: <87bt9u3oof.fsf@cabulja.herceg.de> Pierluigi Vittori writes: > > On ven, 15 ott 1999, Slaven Rezic wrote: > > > Hello Cameron, hello Pierluigi, > > > > I use the algorithm A* to get the shortest path between two places. I > > don't know what's the format of the mapserver data, but I think it > > should be easy to make it usable by my perl module. The module is part > > of a larger system. The sources can be found under > > http://pub.cs.tu-berlin.de/src/BBBike > > Hello Slaven! > > can you indicate any papers or other kind of references to turn to for a > theoretical background on such an issue? > I appreciate your help very much. Thanks. > Here are some: Kanal, L.; and Kumar, V., Search in Artificial Intelligence, Springer-Verlag New York, 1988. Korf, Richard E., Optimal Path-Finding Algorithms, in Search in Artificial Intelligence, Springer-Verlag New York, 1988, pages 233-241. Below is a sample implementation of the algorithm in perl. Regards, Slaven ###################################################################### # -*- perl -*- # # $Id: BBBikeDiplom.pm,v 1.3 1999/08/26 19:51:59 eserte Exp $ # Author: Slaven Rezic # # Copyright (C) 1999 Slaven Rezic. All rights reserved. # This package is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # # Mail: eserte at cs.tu-berlin.de # WWW: http://user.cs.tu-berlin.de/~eserte/ # package BBBikeDiplom; use Strassen; package StrassenNetz; # implementiert die Suche mit dem Algorithmus A* sub search_A_star { my($self, $from, $to) = @_; if ($data_format != 1) { die "Only implemented for data format 1"; } my $net = $self->{Net}; # %OPEN entspricht der Liste OPEN aus der Algorithmusbeschreibung # Der Key des Hashs ist der Knoten n (die Koordinate im # Stra?ennetz), der Value ist ein Array, wovon das erste Element # den Vorg?nger enth?lt (oder undef) und das zweite Element die # bisherige L?nge g(n). # Der Startknoten wird sofort in OPEN eingef?gt (Punkt 1) my %OPEN = ($from => [undef, 0]); my %CLOSED; while (1) { # Punkt 2: es gibt keine L?sung if (keys %OPEN == 0) { return (); } # Punkt 3 my(@sort_list) = sort { # nach Minimum Sortieren $a->[0] <=> $b->[0] } map { # f = g + h berechnen my $f = $OPEN{$_}->[1] + Strassen::Util::strecke_s($_, $to); [$f, $_]; } keys %OPEN; # der Knoten (Koordinaten) des Minimums my $min_node = $sort_list[0]->[1]; # ... wird aus OPEN nach CLOSED bewegt $CLOSED{$min_node} = $OPEN{$min_node}; delete $OPEN{$min_node}; # Punkt 4 if ($min_node eq $to) { my @path; my $len = 0; while (1) { push @path, $min_node; my $prev_node = $CLOSED{$min_node}->[0]; if (defined $prev_node) { $len += Strassen::Util::strecke_s($min_node, $prev_node); $min_node = $prev_node; } else { last; } } @path = map { [ split(/,/, $_) ] } reverse @path; return (\@path, $len, 0, 0, 0); } # Punkt 5 my @successors = keys %{ $net->{$min_node} }; foreach my $successor (@successors) { my $g = $CLOSED{$min_node}->[1] + # bisherige L?nge bis n $net->{$min_node}{$successor}; # L?nge bis n' my $f = $g + Strassen::Util::strecke_s($min_node, $to); # h(n') if (!exists $OPEN{$successor} and !exists $CLOSED{$successor}) { $OPEN{$successor} = [$min_node, $g]; } else { my $OPEN_OR_CLOSED; if (exists $OPEN{$successor}) { $OPEN_OR_CLOSED = $OPEN{$successor}; } else { $OPEN_OR_CLOSED = $CLOSED{$successor}; } if ($f < $OPEN_OR_CLOSED->[1]) { $OPEN_OR_CLOSED = [$f, $min_node]; if (exists $CLOSED{$successor}) { $OPEN{$successor} = $CLOSED{$successor}; delete $CLOSED{$successor}; # hier oder immer? XXX } } } } } } 1; __END__ ###################################################################### -- use Tk;$c=tkinit->Canvas(-he,20)->grid;$x=5;map{s/\n//g;map{$c->create('line'=> map{$a=-43+ord;($x+($a>>3)*2=>5+($a&7)*2)}split//)}split/!/;$x+=12}split/_/=>'K PI1_+09IPK_K;-OA1_+K!;A__1;Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+ KN._K+1Q!.F_1+KN.Q_+1Q__+1!KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q_';MainLoop From cshorte2 at csc.com Tue Oct 19 18:47:18 1999 From: cshorte2 at csc.com (cshorte2 at csc.com) Date: Wed, 20 Oct 1999 11:47:18 +1000 Subject: Shortest path problem (translating from German) Message-ID: <85256810.000ACA12.00@csc.com> If you are having problems understanding the German comments you can translate it at: http://babelfish.altavista.digital.com/ From pgallen at randomlogic.com Fri Oct 22 18:01:51 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Fri, 22 Oct 1999 18:01:51 -0700 Subject: LArge area mapping problem. Message-ID: <381108FF.303D3020@randomlogic.com> I'm having a problem navigating larger maps. I'm not sure if it's my data or what. I have a map of Pennsylvania that was made by combining all the TIGER county shapefiles into a single shapefile. Displaying the initial map looks OK, with one exception: the county names are displayed off the top of the map (out of the visible map area). An additional problem comes into effect when panning/zooming. Clicking anywhere in the map for a pan or zoom does not zoom into the location clicked, but off to the lower right by some amount. Also, if I set the Zoom to 1, and click the "Refresh/Query" button, instead of the map simply refreshing what is already there, it pans in some direction (I think down and right) by some amount. I'm using MapServer 3.20, and to see what it's doing for yourself, visit http://24.5.14.144. I've checked my map extents and they look to be OK (they are in DD, same as the original data). PGA From pgallen at randomlogic.com Fri Oct 22 18:06:46 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Fri, 22 Oct 1999 18:06:46 -0700 Subject: LArge area mapping problem. References: <381108FF.303D3020@randomlogic.com> Message-ID: <38110A26.921C2A30@randomlogic.com> In the last paragraph, I said "I'm using MapServer 3.20...", I meant MapServer 3.2.20. I haven't compiled 3.2.21 yet, though I did D/L it. PGA "Paul G. Allen" wrote: > > I'm having a problem navigating larger maps. I'm not sure if it's my data or > what. I have a map of Pennsylvania that was made by combining all the TIGER > county shapefiles into a single shapefile. Displaying the initial map looks OK, > with one exception: the county names are displayed off the top of the map (out > of the visible map area). An additional problem comes into effect when > panning/zooming. Clicking anywhere in the map for a pan or zoom does not zoom > into the location clicked, but off to the lower right by some amount. Also, if I > set the Zoom to 1, and click the "Refresh/Query" button, instead of the map > simply refreshing what is already there, it pans in some direction (I think down > and right) by some amount. > > I'm using MapServer 3.20, and to see what it's doing for yourself, visit > http://24.5.14.144. I've checked my map extents and they look to be OK (they are > in DD, same as the original data). > > PGA From cshorter at optusnet.com.au Sun Oct 24 01:49:08 1999 From: cshorter at optusnet.com.au (Cameron Shorter) Date: Sun, 24 Oct 1999 18:49:08 +1000 Subject: Speeding up mapping applications by changing data structures References: <37E2AF6E.C44205EC@home.com> <37F723AB.93350DDA@optusnet.com.au> <37F78890.291DC130@home.com> Message-ID: <3812C804.1FF2CBCC@optusnet.com.au> I recently heard a speach from one of the silicon graphics guys, who explained, among other things, where technology is heading, and what that means for writing programs. CPU instruction speeds are increasing faster than RAM access speeds. Hence, with old machines, an access to RAM took one CPU cycle, now RAM accesses take lots of CPU cycles. Also, it is faster to access a block of RAM than it is to access the same ammount of data from a number of different locations, partly because CPUs now make use of memory look ahead. What this means, is that programs should use pointers sparingly, and I belive this explains Steve's comment that the Shapelib 1.2 algorithms are significantly slower than Shapelib 1.1. The shape object in shapefil.h is copied below: typedef struct { int nSHPType; int nShapeId; /* -1 is unknown/unassigned */ int nParts; int *panPartStart; int *panPartType; int nVertices; double *padfX; double *padfY; double *padfZ; double *padfM; double dfXMin; double dfYMin; double dfZMin; double dfMMin; double dfXMax; double dfYMax; double dfZMax; double dfMMax; } SHPObject; Note that the X,Y,Z,M coordinates are in seperate NULL terminated lists. When a vertex is accessed, 4 seperate pointers need to be resolved. The ESRI shapefile record stucture stores the data much more efficently as (X,Y,Z,M),(X,Y,Z,M),... Steve, Your structures for the next release are better, however I belive they can be improved also. As I understand it, an object is of the form: (line1, line2, line3, ...) which expands out to: (nPoints,(x,y),(x,y),..) , (nPoints,(x,y),(x,y),..), ... I suspect you could improve efficiency slightly if the "nPoints" is moved out into another array similar to the ESRI structure, although improvements would probably be marginal. Steve and Frank, To help the structure of supporting packages, it would be good if coordinates are writting as an array - ( c[0],c[1],c[2],c3 ) instead of (x,y,z,m). It would then be easier to write generic procedures which can handle 2, 3, or 4 dimentional coordinates. Lastly, I realise that data structures effects everything that depends upon it, and hence a lot of work, so I'm not expecting you to change everything. From ddnebert at usgs.gov Mon Oct 25 11:55:46 1999 From: ddnebert at usgs.gov (Doug Nebert) Date: Mon, 25 Oct 1999 14:55:46 -0400 Subject: Using Java with mapserver Message-ID: <3814A7B2.5178867@usgs.gov> I have a need to build a lightweight java applet that will permit pan and zoom into a certain extent, then allow the user to drag a rectangle (yes, java can do this!) to set an area of interest. The result of all of this is a bit anticlimactic: I only need the transformed coordinates of the rectangle fed to a containing HTML as shared variables. I have a program that uses LiveConnect to pass the java variables to the hosting form. But I was wondering if someone else has some java stubs for making draw, pan, and zoom requests of a mode=map service... -- Douglas D. Nebert Clearinghouse Coordinator FGDC Secretariat Phone: +1 703 648 4151 Fax: +1 703 648-5755 Pager Messaging: http://fgdclearhs.er.usgs.gov/dougmsg.html From steve.lime at dnr.state.mn.us Mon Oct 25 12:26:23 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Mon, 25 Oct 1999 14:26:23 -0500 Subject: Using Java with mapserver Message-ID: I've already done this. I have a little LiveConnect applet that is used to do box zooms and/or selects. See the data deli (http://deli.dnr.state.mn.us/) for an example. On the deli the user pans/zooms using box or point/zoomsize controls and can go into a query mode that uses the same mechanism to create a query. If this looks like what you're interested in then I'll post the java code and instructions for use. Nice thing is that the applet is a whopping 6k in size, nice and small. Note: the deli uses public methods within the applet to toggle box creation on/off. This makes the interface a little cleaner. So, for example, when zooming out you don't want to be able to drag a box. Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us >>> Doug Nebert 10/25 1:55 PM >>> I have a need to build a lightweight java applet that will permit pan and zoom into a certain extent, then allow the user to drag a rectangle (yes, java can do this!) to set an area of interest. The result of all of this is a bit anticlimactic: I only need the transformed coordinates of the rectangle fed to a containing HTML as shared variables. I have a program that uses LiveConnect to pass the java variables to the hosting form. But I was wondering if someone else has some java stubs for making draw, pan, and zoom requests of a mode=map service... -- Douglas D. Nebert Clearinghouse Coordinator FGDC Secretariat Phone: +1 703 648 4151 Fax: +1 703 648-5755 Pager Messaging: http://fgdclearhs.er.usgs.gov/dougmsg.html From pgallen at randomlogic.com Mon Oct 25 20:07:12 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Mon, 25 Oct 1999 20:07:12 -0700 Subject: I don't get it, Penn. is still messed up. Message-ID: <38151AE0.24C50C60@randomlogic.com> After fixing the inconsistency between the image size between the template file and the map file, the pan/zoom now seems to work fine. The county names are still FUBAR though. I added some nice large point symbols to indicate where MapServer was plotting the county name points themselve, and they are all plotting correctly. The labels however, are FUBAR - they are all WAY above the map, and begin to float down as you zoom in. What's up with that? PGA From pgallen at randomlogic.com Mon Oct 25 20:37:00 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Mon, 25 Oct 1999 20:37:00 -0700 Subject: Yet another small map utility Message-ID: <381521DC.B7FB8006@randomlogic.com> I wrote a small map utility using the shapelib API for creating shapefiles (yes, I know, there are several already, but none were exactly what I wanted). This particular utility takes several command line arguments and makes a complete POINT shapefile from them. If you look at my Philadelphia map, you'll see a couple red SIZE 10 points that were created by this little utility. The command line format is: [root at igen /root]# $SHAPELIB/unitoshape unitoshape [path] shapetype LAT LONG ID equip_type msg_time [string_array] Where string_array is: string_array may be repeated for as many DBASE fields as necessary, up to the max argv[] limit of the OS. (NOTE: $SHAPELIB is an env. variable that makes things easier for me, it's not required for the utility. It just points to my shapelib development dir.) [path] = the path and file name of the shapefile to create or append to (no extension, the utility adds them) shapetype = The shape type to create. Only supports POINTs for now (that's all I need right now) LAT LONG = Dotted decimal latitude and longitude of the shape position ID = A numerical ID of the shape of type INTEGER equip_type = A string describing what this shape is (e.g., Warehouse) msg_time = The time that this shapes data was last updated, a string. The first seven command line options are required, but the DBASE fields are not. The reason I wrote this is to take data from a number of different sources, in any number of different formats, and plot them on a map, as well as create DBASE files that could be queried by MapServer. A couple simple Perl scripts can (and will) be written to extract data from an SQL database, an email message, or whatever, and pipe the data to the unitoshape utility for quick and painless plotting. Basically, I have a universal interface for data extraction and insertion with the ability to support additional data formats quickly - maybe today I have the data in a SQL database, and tomorrow I have it in simple text files. If anyone would like this utility, and a couple Perl scripts to go with it, I'll be posting them soon. I want to add a file locking mechanism first so that the same shapefile won't be updated by two unitoshape processes at the same time. I also plan to make the script create a backup of the original shapefile during updates to prevent corruption and web page access delays when a web browser tries to access a shapefile that's being updated. PGA From steve.lime at dnr.state.mn.us Tue Oct 26 08:24:08 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Tue, 26 Oct 1999 10:24:08 -0500 Subject: Speeding up mapping applications by changing data structures Message-ID: Your points are well taken. I chose the more structured approach for a couple of reasons: - readablity. I actually made the jump from the ESRI xyxyxyxy way of doing things when implementing new clipping functionality in version 3.2. Working with the xyxyxyxy list isn't hard, but dealing with parts arrays was nasty. The code now is a good bit more readable and is much easier to re-visit after a few months. - compatibility. I've always envisioned tapping in to OGC or OGDI resources as a means to extend the MapServer. It's pretty clear that higher level abstractions of a feature would be necessary to make that integration simpler. I've contemplated the switch you outline below a couple of times, but haven't done it. What really changes is the definition of a point- from a structure to an 2 element array. It could be done, a couple hundred changes, but all straight forward. Probably could do it with 2 sed commands. I'd be interested in the performance benefits. Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us >>> Cameron Shorter 10/24 3:49 AM >>> I recently heard a speach from one of the silicon graphics guys, who explained, among other things, where technology is heading, and what that means for writing programs. CPU instruction speeds are increasing faster than RAM access speeds. Hence, with old machines, an access to RAM took one CPU cycle, now RAM accesses take lots of CPU cycles. Also, it is faster to access a block of RAM than it is to access the same ammount of data from a number of different locations, partly because CPUs now make use of memory look ahead. What this means, is that programs should use pointers sparingly, and I belive this explains Steve's comment that the Shapelib 1.2 algorithms are significantly slower than Shapelib 1.1. The shape object in shapefil.h is copied below: typedef struct { int nSHPType; int nShapeId; /* -1 is unknown/unassigned */ int nParts; int *panPartStart; int *panPartType; int nVertices; double *padfX; double *padfY; double *padfZ; double *padfM; double dfXMin; double dfYMin; double dfZMin; double dfMMin; double dfXMax; double dfYMax; double dfZMax; double dfMMax; } SHPObject; Note that the X,Y,Z,M coordinates are in seperate NULL terminated lists. When a vertex is accessed, 4 seperate pointers need to be resolved. The ESRI shapefile record stucture stores the data much more efficently as (X,Y,Z,M),(X,Y,Z,M),... Steve, Your structures for the next release are better, however I belive they can be improved also. As I understand it, an object is of the form: (line1, line2, line3, ...) which expands out to: (nPoints,(x,y),(x,y),..) , (nPoints,(x,y),(x,y),..), ... I suspect you could improve efficiency slightly if the "nPoints" is moved out into another array similar to the ESRI structure, although improvements would probably be marginal. Steve and Frank, To help the structure of supporting packages, it would be good if coordinates are writting as an array - ( c[0],c[1],c[2],c3 ) instead of (x,y,z,m). It would then be easier to write generic procedures which can handle 2, 3, or 4 dimentional coordinates. Lastly, I realise that data structures effects everything that depends upon it, and hence a lot of work, so I'm not expecting you to change everything. From mdh20 at axe.humboldt.edu Tue Oct 26 08:47:53 1999 From: mdh20 at axe.humboldt.edu (Michael Hass) Date: Tue, 26 Oct 1999 08:47:53 -0700 (PDT) Subject: Using Java with mapserver In-Reply-To: Message-ID: I'd be interested to see this posted so that we can try it out on our project. It brings up another java question, when trying to run Example 5 with the java applet, I get an error that it can't load the applet mapimage class mapimage. Is this a path problem or do I need the java code? Thanks, Mike Hass Research Assistant Klamath River Restoration GIS Humboldt State University Arcata, CA On Mon, 25 Oct 1999, Stephen Lime wrote: > I've already done this. I have a little LiveConnect applet that > is used to do box zooms and/or selects. See the data deli > (http://deli.dnr.state.mn.us/) for an example. On the deli the > user pans/zooms using box or point/zoomsize controls and > can go into a query mode that uses the same mechanism to > create a query. If this looks like what you're interested in then > I'll post the java code and instructions for use. Nice thing is that > the applet is a whopping 6k in size, nice and small. > > Note: the deli uses public methods within the applet to toggle > box creation on/off. This makes the interface a little cleaner. > So, for example, when zooming out you don't want to be able > to drag a box. > > Steve > > Stephen Lime > Internet Applications Analyst > MIS Bureau - MN DNR > > (651) 297-2937 > steve.lime at dnr.state.mn.us > > >>> Doug Nebert 10/25 1:55 PM >>> > I have a need to build a lightweight java applet that will permit > pan and zoom into a certain extent, then allow the user to drag a > rectangle (yes, java can do this!) to set an area of interest. The > result of all of this is a bit anticlimactic: I only need the > transformed coordinates of the rectangle fed to a containing HTML > as shared variables. I have a program that uses LiveConnect to pass > the java variables to the hosting form. But I was wondering if > someone else has some java stubs for making draw, pan, and zoom > requests of a mode=map service... > > -- > Douglas D. Nebert > Clearinghouse Coordinator > FGDC Secretariat Phone: +1 703 648 4151 Fax: +1 703 648-5755 > Pager Messaging: http://fgdclearhs.er.usgs.gov/dougmsg.html > > From steve.lime at dnr.state.mn.us Wed Oct 27 11:14:54 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Wed, 27 Oct 1999 13:14:54 -0500 Subject: Java code... Message-ID: Ok. Here's my working version. It's Java 1.1 code and compiles fine under 1.2 except for a few "depricated methods" messages. If anyone is interested in porting to 1.2 and swing let me know. To install: Copy the mapimage.class file someplace on you system that is web accessible. If you need to rebuild from source you'll need to make sure that the Netscape java classes (either a .zip or a .jar) are in your CLASSPATH environment variable. To use: 1. Make sure your normal MapServer form has a name attribute (eg. name="mapserv") 2. Add the following javascript code to the HTML header section: These functions are called by the applet, so the names can't be changed. However, you could change the function code itself to, for example: - submit the form immediately - update the status line of the browser 3. Add a couple of hidden variables to the form: imgbox allows the MapServer to process a pair of mouse clicks (ie. a box). It is ignored if the box is simply a point, hence the initialization value. imgxy is a way to pass a single mouse click to the MapServer. This mimics the standard forms based method. The initial value should be something meaningful like the center of the image. Remember that the coordinates on the image start at 0 and end at nrows-1 or ncols-1. To compute center x use (ncols-1)/2 and y use (nrows-1)/2 and keep the decimal value. This allows the user to zoom using a button rather than the image. 4. Add a call to the applet (this replaces the normal form-based call to the image ). Here's an example from a template file (note the [img] substitution): The parameters are: image - fully qualified URL to the image. This can be a CGI call. jitter - allowable slop in mouse clicking. Basically sets a minimum box size. color - RGB triplet that sets the color of the box or cursor. That covers the basic use. There are 3 public methods that can be called from javascript that change the behavior of the applet. boxOn and boxOff toggle the applets ability to display a dragged box. Useful when adding features to an interface. For example, it doesn't make sense to drag a box when zooming out. No arguments. newMap(string image_url) allows you to swap images without changing the rest of the page. The function uses the java MediaTracker interface to delay image loading until the new image is completely loaded. This is useful with advanced interface setup. It's possible to manage extents, layers etc completely on the client using javascript requesting a new image only when necessary via the applet. It's actually pretty cool once it's set up that way. The string supplied to newMap must be a fully qualified URL for an image (can be a CGI call). Examples of this applet can be found at: - http://deli.dnr.state.mn.us/ - http://www.dnr.state.mn.us/mis/gis/gislis99/example1.html (click "next step" until you hit example 5) - http://www.ra.dnr.state.mn.us/ Possible enhancements: - displaying coordinates on the image as the mouse moves - bubble attributes (eg. move mouse over feature label and display attributes or whatever) Hope this helps, have fun! Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us -------------- next part -------------- A non-text attachment was scrubbed... Name: mapimage.java Type: application/octet-stream Size: 4744 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mapimage.class Type: application/octet-stream Size: 5320 bytes Desc: not available URL: From steve.lime at dnr.state.mn.us Thu Oct 28 07:38:55 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Thu, 28 Oct 1999 09:38:55 -0500 Subject: updated java... Message-ID: Hi: Here's a new version of the mapimage applet. I just changed the behavior when the image is loading a bit. Nothing major but it's a bit faster. Note this is still Java 1.0 API code. The mouse events need to be messed with to make it 1.1+ compliant. However, the old code works with older browsers... Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us -------------- next part -------------- A non-text attachment was scrubbed... Name: mapimage.java Type: application/octet-stream Size: 4731 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mapimage.class Type: application/octet-stream Size: 5292 bytes Desc: not available URL: From ddnebert at usgs.gov Thu Oct 28 13:39:47 1999 From: ddnebert at usgs.gov (Doug Nebert) Date: Thu, 28 Oct 1999 16:39:47 -0400 Subject: Java Script questions Message-ID: <3818B493.A0CA7B65@usgs.gov> I have been attempting to apply the mapimage.java implementation and have been having a number of problems: mostly due to lack of proficiency with JavaScript and the exchange of information between HTML and the applet. Current implementation: http://clearinghouse3.fgdc.gov/global.html The short explanation is that I cannot get the map to zoom. If I use a setting as suggested: First of all I don't see the map, just a big blue image. Which implies that I am actually seeing the map, but am stuck out in the ocean at some pixel coordinates instead of at some "geographic" coordinates. I notice that if I use the rectangle box to zoom it is somehow setting &imgbox=102+45+270+143 in the GET call I see, but that doesn't mean much in the registered image coordinates. I need to be able to translate the pixel coordinates into the "lat-long" coordinates 1) to pass to the mapserver to help formulate a &mapext and 2) to report the rectangle's coordinates out to the HTML form using it for other purposes. I am not sure how to approach this and whether/how to use Java or JavaScript to enable it. As a side note, I do want to be able to use this map selection in the context of a bigger "form" to which I can post the coordinates pulled from the map. This may suggest that I need to use Java exclusively as a component in a bigger form, right? This will take several steps: 1. Store the current latitude and longitude values for the displayed map. On startup these are: latmin = -90, latmax = 90, longmin = -180, and longmax = 180 though these could also be set in the calling HTML file for different startup regions. Where/how do I do this? 2. Collect a rectangle within the java applet. This appears to set imgxy and imgbox values as the pixel coordinates measureed from the upper left corner of the canvas. This seems to be done already. 3. I think that one would need to calculate the appropriate map dimensions to grab based on the doodled rectangle. One would determine the coordinate bounds of a rectangle that more than encloses the selected rectangular region. I will always request a map that is twice as wide as it is tall (360 W-E x 180 N-S degrees sets my design aspect ratio). This seems to be done instead inside the applet: SetImageBox(\"" + Math.min(x1,x2) + " " + Math.min(y1,y2) + " " + Math.max(x1,x2) + " " + Math.max(y1,y2) + "\"); "); Doesn't this request pixel coordinates rather than geographic coordinates? I need some external control to derive not the imgbox but two mapext values and pack them into the GET command: I need the requested map extent, and I need the selected rectangle bounds drawn on it. The transformation math is as follows: xCoord = longmin + (( x / wide ) * ( longmax - longmin )); yCoord = latmin + ((( tall - y ) / tall ) * ( latmax - latmin )); where wide = 500 and tall = 250 as integer pixel values. How do I differentiate between the red rectangle coordinates and the mapext requesting coordinates? I need to set and manage both. 4. Request a map with the correct latitude and longitude values expressed in the &mapext settings, and not use "zoom" at all via the GET method (or java equivalent). 5. Have the selection rectangle shown in red on the resulting map. Tutorial advice on how to achieve this would be appreciated, as I am sure many of you have dealt with these kind of issues before. By your suggestions, I can better understand how this all works. As I describe it here, I come to the conclusion that I probably need a full java applet to do all the interaction I need... Any suggestions or examples? -- Douglas D. Nebert Clearinghouse Coordinator FGDC Secretariat Phone: +1 703 648 4151 Fax: +1 703 648-5755 Pager Messaging: http://fgdclearhs.er.usgs.gov/dougmsg.html From pgallen at randomlogic.com Thu Oct 28 20:01:57 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Thu, 28 Oct 1999 20:01:57 -0700 Subject: HTML Help Message-ID: <38190E25.69DA83A5@randomlogic.com> Thanks to the KPLUG list for the help on password protecting my map web pages. My San Diego map now requires a password to access. (I needed to do this because there may be sensitive data on it). The other pages are still available to the general public though. PGA From jBiza at muhb.cz Thu Oct 28 23:42:17 1999 From: jBiza at muhb.cz (=?windows-1250?Q?B=ED=9Ea_Josef_ing=2E?=) Date: Fri, 29 Oct 1999 08:42:17 +0200 Subject: Java code... Message-ID: Thank you very much Steve. Josef Biza Town Hall Havlickuv Brod Havlickovo namesti 57 580 01 Havlickuv Brod. Czech Republic. From cshorter at optusnet.com.au Fri Oct 29 03:19:20 1999 From: cshorter at optusnet.com.au (Cameron Shorter) Date: Fri, 29 Oct 1999 20:19:20 +1000 Subject: mapserver modify shape proposal References: Message-ID: <381974A8.703D69B6@optusnet.com.au> Tim Ogg wrote: > > Cameron - > > I have seen your communication with the mapserver discussion group and Steve Lime about > adding shape file modification capability to mapeserver. I am not a programmer. I am merely a GIS person > who has an application that would require shape file editing via a browser using something like mapserver. > I don't want to pay for something like ESRI-IMS if I don't have to. > > From the discussion archive it isn't clear if you are actually going to attempt to implement editing > capabilities or not. Where do you stand on the issue? If you plan to go ahead, do you have an > intended timeline at all? I know this is most likely a situation where you work on it when you can > and it is impossible to know the timeline but I thought it couldn't hurt to ask. Tim, Yes, I am working on a web based modify-map program. It will be a seperate program to mapserver, but should dovetail with it well. Much as I'd like to work on this full time, I have to earn my keep as well, so timelimes are pushed out a bit, but this is a very rough idea of what I'm expecting to have completed and when: End of November : Finish cgi parser (I'm half way through this now) January (ish) : Allow a user to add a shape to a ERSI object March 2000 : Write some front end application (in java or javascript) that will allow an operator to add a map. June 2000 : Incorporate Modify/Delete capabilities September 2000 : Clean up error handling and so forth This is assuming that no one volunteers to help out. From bowenj at gaiaenv.com Fri Oct 29 07:40:59 1999 From: bowenj at gaiaenv.com (Jim T. Bowen (GAIA Consultants Inc.)) Date: Fri, 29 Oct 1999 08:40:59 -0600 Subject: Query template file question Message-ID: <3819B1FB.CF27D26D@gaiaenv.com> Hi all, Probably a question for Steve, but perhaps someone else can help. We are using PHP3 to access database information via our site. We are also using PHP3 to link MapServer with PostgreSQL. The links are rudimentary at this point, but show potential. At this point, all we have in place is: Query function passes a unique id to PHP3 script that then performs a query on PostgreSQL and dynamically creates html output. My question lies in the 'query template' identified in the MapServer map file. The docs indicate that output can be passed to an URL or template file. I cannot find docs or eg. relating to passing the query info. to an URL. I would like to do this because MapServer does not recognise a .PHP3 extension as a valid html template file. I think I found where I would need to change this in the source, but perhaps someone could shed some light on this (C is not my forte). I do not want to dick with my apache settings...I believe source change would be fastest and least intrusive to our web server. Currently, I have a temporary html template that grabs MapServer variables, and passes them via the URL string, using an http-equiv redirect. (yuck) I would have included the URL for the site, but the information is confidential (client request...sorry). Thanks in advance. Cheers, Jim ___________________________________ GGG G AAA III AAA | Jim T. Bowen, M.Sc., President | G GG A I A | | G G A A I A A |Suite 306, 822-11th Ave. S.W. | G G A A I A A |Calgary, Alberta, Canada T2R 0E5 | G A A I A A |Ph: 403-571-7213 Fax: 403-571-7211| G GGGG A A I A A |_______bowenj at gaiaenv.com__________| G G AAAAA I AAAAA ICQ: 15567315 G G A A I A A http://www.gaiaenv.com G G A A I A A GGGG AAA AAA III AAA AAA From bfraser at geoanalytic.com Fri Oct 29 08:12:44 1999 From: bfraser at geoanalytic.com (Brent Fraser) Date: Fri, 29 Oct 1999 09:12:44 -0600 Subject: Query template file question References: <3819B1FB.CF27D26D@gaiaenv.com> Message-ID: <000901bf2220$0d55d510$390002c0@servo> Jim, I'm not sure what version of MapServer you're running, but if it's recent, have a look at the mapserv.ini file. It has an entry for setting the template extension: # File extention of template html files. Should be a regular expression. This # usually doesn't need to be changed. TEMPLATE_EXTENSION=\.html$ I'm not sure if this will solve your problem though. If it doesn't, perhaps you could explain the flow of control between mapserver and PHP3 in more detail. Brent Fraser ----- Original Message ----- From: Jim T. Bowen (GAIA Consultants Inc.) To: MapServer Sent: Friday, October 29, 1999 8:40 AM Subject: Query template file question > Hi all, > > Probably a question for Steve, but perhaps someone else can help. > > We are using PHP3 to access database information via our site. We are > also using PHP3 to link MapServer with PostgreSQL. The links are > rudimentary at this point, but show potential. At this point, all we > have in place is: Query function passes a unique id to PHP3 script that > then performs a query on PostgreSQL and dynamically creates html > output. > > My question lies in the 'query template' identified in the MapServer map > file. The docs indicate that output can be passed to an URL or template > file. I cannot find docs or eg. relating to passing the query info. to > an URL. I would like to do this because MapServer does not recognise a > .PHP3 extension as a valid html template file. I think I found where I > would need to change this in the source, but perhaps someone could shed > some light on this (C is not my forte). I do not want to dick with my > apache settings...I believe source change would be fastest and least > intrusive to our web server. Currently, I have a temporary html > template that grabs MapServer variables, and passes them via the URL > string, using an http-equiv redirect. (yuck) > > I would have included the URL for the site, but the information is > confidential (client request...sorry). Thanks in advance. > > > Cheers, > Jim > ___________________________________ GGG G AAA III AAA > | Jim T. Bowen, M.Sc., President | G GG A I A > | | G G A A I A A > |Suite 306, 822-11th Ave. S.W. | G G A A I A A > |Calgary, Alberta, Canada T2R 0E5 | G A A I A A > |Ph: 403-571-7213 Fax: 403-571-7211| G GGGG A A I A A > |_______bowenj at gaiaenv.com__________| G G AAAAA I AAAAA > ICQ: 15567315 G G A A I A A > http://www.gaiaenv.com G G A A I A A > GGGG AAA AAA III AAA AAA > From kenboss at dilbert.dnr.state.mn.us Fri Oct 29 08:31:04 1999 From: kenboss at dilbert.dnr.state.mn.us (kenboss at dilbert.dnr.state.mn.us) Date: Fri, 29 Oct 1999 10:31:04 -0500 (CDT) Subject: Query template file question Message-ID: <199910291531.KAA07517@philbert.dnr.state.mn.us> Jim-- If I'm understanding your question correctly, all you need to do is to put the URL in quotes after the "template" keyword in the query block in your map file. So, instead of something like this: LAYER ... ... QUERY TEMPLATE "http://www.dnr.state.mn.us/someapp/somefile.html" END END You have something like this: LAYER ... ... QUERY TEMPLATE "http://www.dnr.state.mn.us/perl/lk_search.pl?var1=[SOMEFIELD]&var2=[ANOTHER_FIELD]" END END Where [SOMEFIELD] and [ANOTHER_FIELD] are attributes of the shape that the user clicked on (eg., the unique id you want to pass to your PHP3 script). This can have all sorts of cool applications, for example, we use: LAYER NAME counties TYPE polyline STATUS default DATA counties CLASS NAME "County Boundaries" SYMBOL 1 SIZE 1 COLOR 0 0 0 END QUERY TEMPLATE "http://www.ra.dnr.state.mn.us/cgi-bin/mapserv3.2?map=photos/etc/photos.map&mapext=[shpext]" END END # Layer counties to allow users to zoom in to the extent of a county from an initial statewide interface (see http://www.ra.dnr.state.mn.us/photos/photos_init.html). Note that in this case [shpext] is not an attribute of the shape per se (that is, it's not stored in the .dbf file), but is a value calculated by the mapserver software (documented at http://mapserver.gis.umn.edu/templates.html). Hope this helps, --Ken ============================================================================ Ken Boss Digital Image Analysis / Web Stuff Forestry Resource Assessment kenboss at dilbert.dnr.state.mn.us Minnesota Dept. of Natural Resources Voice: 218 327 4449 ext. 237 413 SE 13th Street Fax: 218 327 4517 Grand Rapids, MN 55744 USA ============================================================================ From bowenj at gaiaenv.com Fri Oct 29 08:43:10 1999 From: bowenj at gaiaenv.com (Jim T. Bowen (GAIA Consultants Inc.)) Date: Fri, 29 Oct 1999 09:43:10 -0600 Subject: Query template file question References: <3819B1FB.CF27D26D@gaiaenv.com> <000901bf2220$0d55d510$390002c0@servo> Message-ID: <3819C08E.276E74B7@gaiaenv.com> Cheers Brent. We are running 3.219b...never thought of checking the ini (still have to get use to that feature!). I will give it a try later today. Jim Brent Fraser wrote: > > Jim, > > I'm not sure what version of MapServer you're running, but if > it's recent, have a look at the mapserv.ini file. It has an entry > for setting the template extension: > > # File extention of template html files. Should be a regular expression. > This > # usually doesn't need to be changed. > TEMPLATE_EXTENSION=\.html$ > > I'm not sure if this will solve your problem though. If it doesn't, > perhaps you could explain the flow of control between mapserver > and PHP3 in more detail. > > Brent Fraser > > ----- Original Message ----- > From: Jim T. Bowen (GAIA Consultants Inc.) > To: MapServer > Sent: Friday, October 29, 1999 8:40 AM > Subject: Query template file question > > > Hi all, > > > > Probably a question for Steve, but perhaps someone else can help. > > > > We are using PHP3 to access database information via our site. We are > > also using PHP3 to link MapServer with PostgreSQL. The links are > > rudimentary at this point, but show potential. At this point, all we > > have in place is: Query function passes a unique id to PHP3 script that > > then performs a query on PostgreSQL and dynamically creates html > > output. > > > > My question lies in the 'query template' identified in the MapServer map > > file. The docs indicate that output can be passed to an URL or template > > file. I cannot find docs or eg. relating to passing the query info. to > > an URL. I would like to do this because MapServer does not recognise a > > .PHP3 extension as a valid html template file. I think I found where I > > would need to change this in the source, but perhaps someone could shed > > some light on this (C is not my forte). I do not want to dick with my > > apache settings...I believe source change would be fastest and least > > intrusive to our web server. Currently, I have a temporary html > > template that grabs MapServer variables, and passes them via the URL > > string, using an http-equiv redirect. (yuck) > > > > I would have included the URL for the site, but the information is > > confidential (client request...sorry). Thanks in advance. > > > > > > Cheers, > > Jim > > ___________________________________ GGG G AAA III AAA > > | Jim T. Bowen, M.Sc., President | G GG A I A > > | | G G A A I A A > > |Suite 306, 822-11th Ave. S.W. | G G A A I A A > > |Calgary, Alberta, Canada T2R 0E5 | G A A I A A > > |Ph: 403-571-7213 Fax: 403-571-7211| G GGGG A A I A A > > |_______bowenj at gaiaenv.com__________| G G AAAAA I AAAAA > > ICQ: 15567315 G G A A I A A > > http://www.gaiaenv.com G G A A I A A > > GGGG AAA AAA III AAA AAA > > From bowenj at gaiaenv.com Fri Oct 29 08:49:25 1999 From: bowenj at gaiaenv.com (Jim T. Bowen (GAIA Consultants Inc.)) Date: Fri, 29 Oct 1999 09:49:25 -0600 Subject: Query template file question References: <199910291531.KAA07517@philbert.dnr.state.mn.us> Message-ID: <3819C205.F1445DDD@gaiaenv.com> Thanks Ken, MapServer was reporting that my php3 file was not a valid template file (can't remember the exact error). I will give your suggestion a try later today (along with Brent's). It appears you have been passing variables to files (viz., apps. and scripts) other than plain ol' hmtl files. Thanks for your examples. Cheers, Jim kenboss at dilbert.dnr.state.mn.us wrote: > > Jim-- > > If I'm understanding your question correctly, all you need to do is to put the URL in quotes after the > "template" keyword in the query block in your map file. So, instead of something like this: > > LAYER > ... > ... > QUERY > TEMPLATE "http://www.dnr.state.mn.us/someapp/somefile.html" > END > END > > You have something like this: > > LAYER > ... > ... > QUERY > TEMPLATE "http://www.dnr.state.mn.us/perl/lk_search.pl?var1=[SOMEFIELD]&var2=[ANOTHER_FIELD]" > END > END > > Where [SOMEFIELD] and [ANOTHER_FIELD] are attributes of the shape that the user clicked on (eg., the > unique id you want to pass to your PHP3 script). > > This can have all sorts of cool applications, for example, we use: > > LAYER > NAME counties > TYPE polyline > STATUS default > DATA counties > CLASS > NAME "County Boundaries" > SYMBOL 1 > SIZE 1 > COLOR 0 0 0 > END > QUERY > TEMPLATE "http://www.ra.dnr.state.mn.us/cgi-bin/mapserv3.2?map=photos/etc/photos.map&mapext=[shpext]" > END > END # Layer counties > > to allow users to zoom in to the extent of a county from an initial statewide interface (see > http://www.ra.dnr.state.mn.us/photos/photos_init.html). Note that in this case [shpext] is not an > attribute of the shape per se (that is, it's not stored in the .dbf file), but is a value calculated by > the mapserver software (documented at http://mapserver.gis.umn.edu/templates.html). > > Hope this helps, > > --Ken > > ============================================================================ > Ken Boss > Digital Image Analysis / Web Stuff Forestry Resource Assessment > kenboss at dilbert.dnr.state.mn.us Minnesota Dept. of Natural Resources > Voice: 218 327 4449 ext. 237 413 SE 13th Street > Fax: 218 327 4517 Grand Rapids, MN 55744 USA > ============================================================================ -- ___________________________________ GGG G AAA III AAA | Jim T. Bowen, M.Sc., President | G GG A I A | | G G A A I A A |Suite 306, 822-11th Ave. S.W. | G G A A I A A |Calgary, Alberta, Canada T2R 0E5 | G A A I A A |Ph: 403-571-7213 Fax: 403-571-7211| G GGGG A A I A A |_______bowenj at gaiaenv.com__________| G G AAAAA I AAAAA ICQ: 15567315 G G A A I A A http://www.gaiaenv.com G G A A I A A GGGG AAA AAA III AAA AAA From steve.lime at dnr.state.mn.us Fri Oct 29 11:32:56 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Fri, 29 Oct 1999 13:32:56 -0500 Subject: Cool client and utilities... Message-ID: Hi all: I'm sure most of you are aware of the JShape java GIS client app. Seems like really nice software although I haven't played with it. The author has also developed a shapefile utility called FShape for pre-processing shape files. For example, you can tile and/or generalize a shapefile. It supports some sort of indexing but it's not compatible with the MapServer. All this is done in Java so I don't suppose it's the speediest of tools but it seems pretty useful regardless of the other tools you use. Anyone tried it? Steve Stephen Lime Internet Applications Analyst MIS Bureau - MN DNR (651) 297-2937 steve.lime at dnr.state.mn.us From pgallen at randomlogic.com Fri Oct 29 18:39:04 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Fri, 29 Oct 1999 18:39:04 -0700 Subject: Buttons Message-ID: <381A4C38.94519D85@randomlogic.com> Is it possible to make two buttons on the the map interface to zoom in or zoom out? So far I've only been able to make one that redraws the map (with the rest of the web page) full size - just like it is when the map page is first drawn. PGA From pgallen at randomlogic.com Fri Oct 29 20:31:15 1999 From: pgallen at randomlogic.com (Paul G. Allen) Date: Fri, 29 Oct 1999 20:31:15 -0700 Subject: Java code... References: <381A6401.3B90E72B@randomlogic.com> Message-ID: <381A6683.DBD22801@randomlogic.com> I meant this to go to the list the first time. I forgot to mention, I'm running a RedHat Linux 6.0 system and Apache, so if this is some kind of Winsucks J++ code, please let me know 'cause it won't work for me. Thanks, PGA "Paul G. Allen" wrote: > I followed the directions, and used the dnr.state.mn.us site as a guide. I get > an error in my browser when I try to load the page "Applet mapimage class > mapimage could not be loaded". I tried to compile the source again, and got this > error: > > Connecting... > javac /home/httpd/java/mapimage.java > error "/home/httpd/java/mapimage.java" 14 class JSObject not found in class > mapimage > JSObject win; > ^ > error "/home/httpd/java/mapimage.java" 29 variable JSObject not found in class > mapimage > win = JSObject.getWindow(this); > ^ > 2 errors > make: *** [/home/httpd/java/mapimage.class] Error 255 > Execution complete > > I know absolutely nothing about Java. Can someone clue me in? I'd really like to > use this type of interface. > > Thanks, > > PGA From bowenj at gaiaenv.com Sat Oct 30 08:59:07 1999 From: bowenj at gaiaenv.com (Jim T. Bowen (GAIA Consultants Inc.)) Date: Sat, 30 Oct 1999 09:59:07 -0600 Subject: Query template file question References: <3819B1FB.CF27D26D@gaiaenv.com> Message-ID: <381B15CB.49F27A65@gaiaenv.com> Hello all, I tried both Brent and Ken's suggestions with limited success...perhaps I am missing something simple. Here are my findings: ********************************************************************** *** Brent's suggestion (change the mapserv.ini setting) ************** ********************************************************************** As a simple test, I created a file with no php3 tags, simply straight html [with a couple of MapServer tags (e.g., [shpminx])] and gave the file an extension of '.php3'. I changed the mapserv.ini file to reflect the '.php3' extension for templates. The query worked and MapServer populated the template with information; however, if I try to redraw the map, I receive a 'malformed template' error from MapServer. Any thoughts? Also, does anyone know if it is possible to include more that one regular expression per parameter in mapserv.ini? (e.g., 'TEMPLATE_EXTENSION=\.html$ or TEMPLATE_EXTENSION=\.php3$') I tried this, but received an error 'received 3 parameters, expecting 2'. FYI, I also tried 'TEMPLATE_EXTENSION=\.html$ or \.php3$' ********************************************************************** *** Ken's suggestion (pass args directly to PHP3 via the URL str) **** ********************************************************************** I attempted to pass the arguments to my php3 page as suggested by Ken. I noticed I was not double-quoting my path and filename parameter in my map file. The map file example (http://mapserver.gis.umn.edu/demo_map.txt) does not indicate double-quotes are required. It appears the double-quotes are required only if special characters (e.g., ?, %, etc.) are included in the parameter (my guess). Changing to double-quoted string permitted the passing of arguments from MapServer to PHP3 without error. The result was no 'malformed template' error when drawing the map, but this error did arise when querying. ************** *** Other **** ************** I also tried hybrids of Brent's and Ken's suggestions. Does anyone have any other ideas surrounding this issue? If there are no conclusions in the next couple days, I suggest killing this thread. The 'http-equiv refresh' workaround is not too cumbersome and it does produce results. Thanks in advance. Cheers, Jim ___________________________________ GGG G AAA III AAA | Jim T. Bowen, M.Sc., President | G GG A I A | | G G A A I A A |Suite 306, 822-11th Ave. S.W. | G G A A I A A |Calgary, Alberta, Canada T2R 0E5 | G A A I A A |Ph: 403-571-7213 Fax: 403-571-7211| G GGGG A A I A A |_______bowenj at gaiaenv.com__________| G G AAAAA I AAAAA ICQ: 15567315 G G A A I A A http://www.gaiaenv.com G G A A I A A GGGG AAA AAA III AAA AAA From steve.lime at dnr.state.mn.us Sat Oct 30 08:59:49 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Sat, 30 Oct 1999 10:59:49 -0500 Subject: Java code... Message-ID: No, pure Java. Wrote latest version on a Linux box. You need to add the netscape java classes to your CLASSPATH environment variable. Mine looks like this on RH 6.0. CLASSPATH=/usr/local/jdk117_v3/lib/classes.zip:/usr/lib/netscape/java/classes/java40.jar Yours would vary depending on what JDK your using and what version of communicator is laying around. Unless you're adding stuff to the src you shouldn't nee to recompile and can just use the class file I sent. Steve <<< "Paul G. Allen" 10/29 10:32p >>> I meant this to go to the list the first time. I forgot to mention, I'm running a RedHat Linux 6.0 system and Apache, so if this is some kind of Winsucks J++ code, please let me know 'cause it won't work for me. Thanks, PGA "Paul G. Allen" wrote: > I followed the directions, and used the dnr.state.mn.us site as a guide. I get > an error in my browser when I try to load the page "Applet mapimage class > mapimage could not be loaded". I tried to compile the source again, and got this > error: > > Connecting... > javac /home/httpd/java/mapimage.java > error "/home/httpd/java/mapimage.java" 14 class JSObject not found in class > mapimage > JSObject win; > ^ > error "/home/httpd/java/mapimage.java" 29 variable JSObject not found in class > mapimage > win = JSObject.getWindow(this); > ^ > 2 errors > make: *** [/home/httpd/java/mapimage.class] Error 255 > Execution complete > > I know absolutely nothing about Java. Can someone clue me in? I'd really like to > use this type of interface. > > Thanks, > > PGA From steve.lime at dnr.state.mn.us Sat Oct 30 09:22:55 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Sat, 30 Oct 1999 11:22:55 -0500 Subject: Query template file question Message-ID: Ok. The comments in the .ini file say that the value for TEMPLATE_VALUE should be a regular expression. The examples you show are not regular expresions, hence there problems. O'Reilly has an excellent regex reference book in case anyone in is interested. You have the right idea (or'ing), but the syntax is all wrong. Corrent me if I'm wrong , but CGI processes return content directly to the browser. I don't believe you can have PHP process a page generated by the MapServer. I know this used to be the case but haven't researched it in a while. In general, I've chained things together using URL forwarding. MapServer forwards its stuff to another URL, bypassing the browser. That's what Ken was suggesting. Other than the double quotes issue it sounds as if that worked for you. Another way to do it is to use JavaScript. You can create a page that is essentially empty except for some javascript. That code can be initialized using standard mapserver substitutions and then can either build the page itself or replace the page with some URL. Example 5 in the short tutorial I mention on the list in late Sept does exactly this. Can be very powerful. If anyone knows of a way to filter a page from CGI before it is sent to the client, speak up. I'd love to be able to even just use simple SSI in a template file. Of course, with mapscript much of this becomes a thing of the past as you can do all of your mapping and PHP-like stuff (eg. database) in one script. Steve <<< "Jim T. Bowen (GAIA Consultants Inc.)" 10/30 10:54a >>> Hello all, I tried both Brent and Ken's suggestions with limited success...perhaps I am missing something simple. Here are my findings: ********************************************************************** *** Brent's suggestion (change the mapserv.ini setting) ************** ********************************************************************** As a simple test, I created a file with no php3 tags, simply straight html [with a couple of MapServer tags (e.g., [shpminx])] and gave the file an extension of '.php3'. I changed the mapserv.ini file to reflect the '.php3' extension for templates. The query worked and MapServer populated the template with information; however, if I try to redraw the map, I receive a 'malformed template' error from MapServer. Any thoughts? Also, does anyone know if it is possible to include more that one regular expression per parameter in mapserv.ini? (e.g., 'TEMPLATE_EXTENSION=\.html$ or TEMPLATE_EXTENSION=\.php3$') I tried this, but received an error 'received 3 parameters, expecting 2'. FYI, I also tried 'TEMPLATE_EXTENSION=\.html$ or \.php3$' ********************************************************************** *** Ken's suggestion (pass args directly to PHP3 via the URL str) **** ********************************************************************** I attempted to pass the arguments to my php3 page as suggested by Ken. I noticed I was not double-quoting my path and filename parameter in my map file. The map file example (http://mapserver.gis.umn.edu/demo_map.txt) does not indicate double-quotes are required. It appears the double-quotes are required only if special characters (e.g., ?, %, etc.) are included in the parameter (my guess). Changing to double-quoted string permitted the passing of arguments from MapServer to PHP3 without error. The result was no 'malformed template' error when drawing the map, but this error did arise when querying. ************** *** Other **** ************** I also tried hybrids of Brent's and Ken's suggestions. Does anyone have any other ideas surrounding this issue? If there are no conclusions in the next couple days, I suggest killing this thread. The 'http-equiv refresh' workaround is not too cumbersome and it does produce results. Thanks in advance. Cheers, Jim ___________________________________ GGG G AAA III AAA | Jim T. Bowen, M.Sc., President | G GG A I A | | G G A A I A A |Suite 306, 822-11th Ave. S.W. | G G A A I A A |Calgary, Alberta, Canada T2R 0E5 | G A A I A A |Ph: 403-571-7213 Fax: 403-571-7211| G GGGG A A I A A |_______bowenj at gaiaenv.com__________| G G AAAAA I AAAAA ICQ: 15567315 G G A A I A A http://www.gaiaenv.com G G A A I A A GGGG AAA AAA III AAA AAA From bowenj at gaiaenv.com Sat Oct 30 10:40:31 1999 From: bowenj at gaiaenv.com (Jim T. Bowen (GAIA Consultants Inc.)) Date: Sat, 30 Oct 1999 11:40:31 -0600 Subject: Query template file question References: Message-ID: <381B2D8F.F56ADBEB@gaiaenv.com> Stephen Lime wrote: > > Ok. The comments in the .ini file say that the value for TEMPLATE_VALUE should be a regular > expression. The examples you show are not regular > expresions, hence there problems. O'Reilly has an > excellent regex reference book in case anyone in > is interested. You have the right idea (or'ing), but the syntax is all wrong. Thanks...too much code in my head and not enough time in the day! I came accross this site...may be a good intro. link for those 'still climbing': http://www.engr.usask.ca/~macphed/UNIX/regexp.html > > Corrent me if I'm wrong , but CGI processes return > content directly to the browser. I don't believe > you can have PHP process a page generated by the > MapServer. I know this used to be the case but > haven't researched it in a while. To the best of my knowledge, you are right re. the flow of results from a CGI process. This is likely one of the insurmountable issues I face, even if I overcome the 'malformed template' issue. It may be that http-equiv or URL forwarding is the easiest/quickest way to address the issue at this time. > > In general, I've chained things together using URL > forwarding. MapServer forwards its stuff to another URL, bypassing the browser. That's what Ken was suggesting. Other than the double quotes > issue it sounds as if that worked for you. Not really. When querying, MapServer still reports a 'malformed template' when I pass the argument-based URL string to a PHP3 file. > > Another way to do it is to use JavaScript. You can > create a page that is essentially empty except for > some javascript. That code can be initialized using standard mapserver substitutions and then > can either build the page itself or replace the page with some URL. Example 5 in the short >tutorial I mention on the list in late Sept does exactly this. Can be very powerful. > > If anyone knows of a way to filter a page from CGI > before it is sent to the client, speak up. I'd love to be able to even just use simple SSI in a > template file. Not sure...would be challenging based on our dialog re. flow between browser and CGI. I too would be interested if anyone knows of a means to accomplish this. > > Of course, with mapscript much of this becomes a > thing of the past as you can do all of your mapping and PHP-like stuff (eg. database) in one > script. > I look forward to mapscript! :) > Steve Cheers, Jim ___________________________________ GGG G AAA III AAA | Jim T. Bowen, M.Sc., President | G GG A I A | | G G A A I A A |Suite 306, 822-11th Ave. S.W. | G G A A I A A |Calgary, Alberta, Canada T2R 0E5 | G A A I A A |Ph: 403-571-7213 Fax: 403-571-7211| G GGGG A A I A A |_______bowenj at gaiaenv.com__________| G G AAAAA I AAAAA ICQ: 15567315 G G A A I A A http://www.gaiaenv.com G G A A I A A GGGG AAA AAA III AAA AAA From marin at here.is Sun Oct 31 06:15:09 1999 From: marin at here.is (Ma) Date: Sun, 31 Oct 1999 14:15:09 +0000 Subject: offsite, transparent color, gd1.3 Message-ID: <381C4EED.962E39B7@here.is> 1. What is "OFFSITE 0" in the raster layer definition (see demo.map)? 2. How to specify transparent color for the raster layer? 3. How to "make" mapserver3.2 with gd1.3? -- Ma From steve.lime at dnr.state.mn.us Sun Oct 31 19:42:21 1999 From: steve.lime at dnr.state.mn.us (Stephen Lime) Date: Sun, 31 Oct 1999 21:42:21 -0600 Subject: offsite, transparent color, gd1.3 Message-ID: Question 2 answers question 1. Offsite is the color index value in the source image to make transparent. "OFFSITE 0" means that all source pixels with value 0 become transparent in the output image. To build with 1.3 you should just have to switch the references in the Makefile to point to the other dist. I don't know if 1.3 is where the GD lib went from column major to row major. If so there are a few other fixes that have to happen. GD is not used at all in processing TRUETYPE fonts so this will not remedy the character mapping issues with latin chars. May fix that with BITMAP fonts assuming the GD version include those characters. Haven't had time to test your sample data yet, will do this week sometime. Steve <<< Ma 10/31 8:14a >>> 1. What is "OFFSITE 0" in the raster layer definition (see demo.map)? 2. How to specify transparent color for the raster layer? 3. How to "make" mapserver3.2 with gd1.3? -- Ma