[Mapserver-users] data/mapfile organization advice sought
Puneet Kishor
pkishor at geoanalytics.com
Tue May 13 05:51:28 PDT 2003
On Tuesday, May 13, 2003, at 02:38 AM, Stepan Kafka wrote:
> There are two approaches:
>
> 1. If you want to show all the countries together, you can effitiently
> use
> tiling for them. It works also with non-rectangular tiling layer and
> your
> data structure is suitable for it.
Interesting. I thought tiling was a viable option only for data that
were contiguous. My data are not -- well, they are, if all show
together, but are actually held in discrete, complete shapefiles like
so --
country1 -- layer1
layer2
..
layer9
layer10
layer11
country2 -- layer1
layer2
..
(not layer9)
layer10
(not layer11)
country3 -- layer1
layer2
..
layer9
(not layer10)
layer11
> 2. If you want show only selected country, you can change the
> shapepath on
> the fly. Set the
> ...&map_shapepath=your_shapepath... in your URL.
no cgi (if that is what you meant)... I am using scripting (perl). But,
that is the line on which I was thinking. Something like so -- I would
have a master map file, kinda like a template, which I would manipulate
on the fly like so --
# my mapfile template
#
..
SHAPEPATH path/to/data/$country_name_var$
..
LAYER
NAME "layer one"
DATE "layer1"
..
# end mapfile template
and then I would replace the $country_name_var$ on the fly based on an
http variable passed by the user based on some selection. Of course, I
would have to write the map file out on the fly, but that is easy. On
the other hand, would I have to write it out? Could I do without
writing it out to disk?
Is that a reasonable approach, or is there a better, more elegant way?
Many tia.
>
> Stepan Kafka
> Help Service Remote Sensing
> tel: +420-327514118
> mailto:kafka at email.cz
> http://www.bnhelp.cz
>
>> -----Pùvodní zpráva-----
>> Od: mapserver-users-admin at lists.gis.umn.edu
>> [mailto:mapserver-users-admin at lists.gis.umn.edu]za uivatele Puneet
>> Kishor
>> Odesláno: 13. kvìtna 2003 6:09
>> Komu: Mapserver
>> Pøedmìt: [Mapserver-users] data/mapfile organization advice sought
>>
>>
>> To ms data mavens -- please give me a piece of your mind.
>>
>> I have shapefile data of several countries, about 14 countries.
>>
>> Each country has 8 to 12 different layers, but they are all called the
>> same. For example, all countries have a layer called "layer1",
>> "layer2", and so on, while a few countries may not have "layer8" or
>> "layer11," etc.
>>
>> If I were to draw all the countries together, they would draw
>> correctly, that is, they are in the correct geographic space. However,
>> their data are self-contained. That is, even though country1 and
>> country2 are contiguous, drawing country1 does not bring up
>> country2...
>> they are in different folders.
>>
>> How do I create and work with their mapfiles?
>>
>> I can't really have one big mongo mapfile with all the layers of all
>> the countries... it would be unworkable, and probably very
>> inefficient.
>>
>> On the other hand, if I have 14 different mapfiles, they will be
>> almost
>> identical to each other except for the path to the data. If I make a
>> tweak in any one mapfile (for example, change the color or visible
>> scale of a layer), I will have to go and change it in 14 different
>> mapfiles.
>>
>> Ideally I would like to have one master mapfile (like a template), and
>> just substitute (on the fly) the path to the data. I guess I could do
>> some preprocessing with Perl, and swap a filter keyword using regexp
>> search, to create a working, valid mapfile on the fly, but I would
>> also
>> have to account for those one or two particular layers that happen to
>> be absent for a given country.
>>
>> Please share your insight.
>>
>> Many tia.
>>
>> Puneet.
>>
>> _______________________________________________
>> Mapserver-users mailing list
>> Mapserver-users at lists.gis.umn.edu
>> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>>
>>
>> ---
>> Príchozí zpráva neobsahuje viry.
>> Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
>> Verze: 6.0.478 / Virová báze: 275 - datum vydání: 6.5.2003
>>
> ---
> Odchozí zpráva neobsahuje viry.
> Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
> Verze: 6.0.478 / Virová báze: 275 - datum vydání: 6.5.2003
More information about the MapServer-users
mailing list