shpcreate & shpadd
Daniel Morissette
morissette at dmsolutions.ca
Tue Dec 19 08:54:56 PST 2000
Kieran,
You could use MapScript's shapeFileObj (and the Perl or PHP DBF module)
to create your files... it would require only one open/close per layer
as you suggested.
If you use PHP, then there is an example of creating shapefiles with the
corresponding DBF entries in the MapServer source distribution in:
mapserver/mapscript/php3/examples/test_writeshape.phtml
Of course, another solution might be to do it directly in C with
shapelib, but then you'll have to write the access to the MySQL database
in C too and you probably don't want that.
Good Luck!
Daniel
"Kieran J. Ames" wrote:
>
> Hello all,
> I'm looking to create some point layers from a MySQL db that has lat/lon
> entries. I wanted to use mapscript, but there is more than a 3 minute
> lag in retreiving the data from the db.
> (I've heavily indexed the db, but calls like "where LAT BETWEEN
> south_value AND north_value AND LON BETWEEN west_value AND east_value"
> return about 500 records out of a possible 1.8 million.) Therefore, I
> thought I'd do some pre-processing and have some layers already
> available... trading disk space for speed.
> I've used shpcreate and shpadd to make the layers, but the disk I/O
> requires an unacceptable amount of activity. (With more than 4 million
> write functions needed between shp, shx & dbf... I'm concerned about
> affecting the life and integrity of my hard drive).
>
> I could use ArcView, but that would be a manual process with more than
> 300 layers to process. Is there any ArcView script running around there
> that could do this? Otherwise, are there any shpcreate, dbfcreate,
> shpadd, dbfadd executables that would take a file name as an argument
> and write the data in one pass? I want to get to one open/write/close
> activity for each layer rather than for each point.
>
> Thanks much for any assistance.
> Kieran
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
http://www.dmsolutions.ca/
------------------------------------------------------------
Don't put for tomorrow what you can do today, because if
you enjoy it today you can do it again tomorrow.
More information about the MapServer-users
mailing list