Changes between Initial Version and Version 1 of MapServerDXF


Ignore:
Timestamp:
Jan 28, 2009, 12:27:25 PM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapServerDXF

    v1 v1  
     1= DXF Output with MapServer =
     2
     3This page should provide information about generating DXF output from mapserver
     4
     5If you have any questions or suggestions, contact the author (Attila Csipa).
     6
     7== What DXF ? ==
     8
     9DXF is a drawing exchange format. It is mainly used in trasferring vector data between different programs.
     10
     11== What does this module do ? ==
     12
     13It generates a DXF file with the same content as a gif or png file would have, only in vector format. Note that this is an export only filter - it does not allow you to use DXF datasets.
     14
     15== Installing ==
     16
     17   1. Get the source from CVS and compile it.
     18   2. Change .MAP file
     19   3. Change your script to generate two maps
     20   4. Change HTML code to include the DXF file
     21
     22== Changing .MAP file ==
     23
     24First, be sure to make a copy of your existing, working .MAP file. We'll need it later. Just add the following:
     25{{{
     26 OUTPUTFORMAT
     27    NAME imagemap
     28    MIMETYPE "text/plain"
     29    DRIVER imagemap
     30    EXTENSION dxf
     31    FORMATOPTION DXF=ON
     32 END
     33}}}
     34DXF output is generated using the ImageMap outputformat driver.
     35
     36== Generating two maps ==
     37
     38The trick is that you have to generate TWO maps. The first map will be your regular .map file, which will generate the image as it was earlier, but you have to generate an additional map, which will contain the dxf. It is essential that the two map files are identical except for the outputformat part. Also, if you intend to manipulate your map from a script, do it for both maps or strange sideeffects may appear.
     39
     40== How to load two maps in PHPMapScript ==
     41{{{
     42 $map_path = "/var/www/mappath/";
     43 $map_file = "regular.map";
     44 $map_file2 = "imagemap.map";
     45
     46 $map = ms_newMapObj?($map_path.$map_file);
     47 $map2 = ms_newMapObj?($map_path.$map_file2);
     48
     49 ...
     50
     51 $image = $map->draw();
     52 $image_url = $image->saveWebImage(MS_PNG,1,1,0);
     53 $image2 = $map2->draw();
     54 $imagemap_url=$image2->saveWebImage(MS_IMAGEMAP,1,1,0);
     55}}}
     56This will generate two temp files - one holding an image and the other holding the dxf.