PDF output with layers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF output with layers

Carlos Ruiz
I'm currently exploring PDF generation from Mapserver and I have noticed that no layers appear to be toggled. First I thought this was because the layer CLASS section has no name (as it happens when legend is generated), but it is not.

gdalinfo test.pdf does not show layers information.

Does anybody know how to configure a MAP file to include layers in the PDF output ?

Here is test.map contents:

MAP

    NAME "test"
    EXTENT 657024 2277645 687240 2294128
    SIZE 800 600
       
    OUTPUTFORMAT
        NAME "pdf"
        DRIVER CAIRO/PDF
        MIMETYPE "application/x-pdf"
        IMAGEMODE RGB
        EXTENSION "pdf"
        FORMATOPTION "GEO_ENCODING=ISO32000"
    END
    
    PROJECTION
        "init=EPSG:32613"
    END
   
    STATUS ON
   
    LAYER
        NAME "Landsat 8"
        CONNECTION "http://localhost/cgi-bin/landsat8.exe"
        CONNECTIONTYPE WMS
        TYPE RASTER
        STATUS ON
        METADATA
            "wms_name" "Landsat 8"
            "wms_srs" "EPSG:32613"
            "wms_server_version" "1.0.0"
            "wms_format" "image/jpeg"
        END
    END
    
    LAYER
        NAME "Colonias"
        CONNECTION "..."
        CONNECTIONTYPE POSTGIS
        DATA "geom FROM colonias_amg"
        TYPE POLYGON
        CLASS
            NAME "Colonias"
            STYLE
                COLOR 255 200 150
                OUTLINECOLOR 0 0 0
            END
        END        
        COMPOSITE
            OPACITY 35
        END
        STATUS ON
    END

END


Thanks in advance

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: PDF output with layers

Andy Colson
On 09/04/2017 09:20 AM, Carlos Ruiz wrote:

> I'm currently exploring PDF generation from Mapserver and I have noticed that no layers appear to be toggled. First I thought this was because the layer CLASS section has no name (as it happens when legend is generated), but it is not.
>
> gdalinfo test.pdf does not show layers information.
>
> Does anybody know how to configure a MAP file to include layers in the PDF output ?
>
> Here is test.map contents:
>
> MAP
>
>      NAME "test"
>      EXTENT 657024 2277645 687240 2294128
>      SIZE 800 600
>
>      OUTPUTFORMAT
>          NAME "pdf"
>          DRIVER CAIRO/PDF
>          MIMETYPE "application/x-pdf"
>          IMAGEMODE RGB
>          EXTENSION "pdf"
>          FORMATOPTION "GEO_ENCODING=ISO32000"
>      END
>
>      PROJECTION
>          "init=EPSG:32613"
>      END
>
>      STATUS ON
>
>      LAYER
>          NAME "Landsat 8"
>          CONNECTION "http://localhost/cgi-bin/landsat8.exe"
>          CONNECTIONTYPE WMS
>          TYPE RASTER
>          STATUS ON
>          METADATA
>              "wms_name" "Landsat 8"
>              "wms_srs" "EPSG:32613"
>              "wms_server_version" "1.0.0"
>              "wms_format" "image/jpeg"
>          END
>      END
>
>      LAYER
>          NAME "Colonias"
>          CONNECTION "..."
>          CONNECTIONTYPE POSTGIS
>          DATA "geom FROM colonias_amg"
>          TYPE POLYGON
>          CLASS
>              NAME "Colonias"
>              STYLE
>                  COLOR 255 200 150
>                  OUTLINECOLOR 0 0 0
>              END
>          END
>          COMPOSITE
>              OPACITY 35
>          END
>          STATUS ON
>      END
>
> END
>
> Thanks in advance
>


How does the pdf look?  Is it empty?

This page:
http://www.gdal.org/frmt_pdf.html

shows the example:

> gdalinfo adobe_style_geospatial.pdf -mdd LAYERS


Does the extra "-mdd LAYERS" help?

Looks like you need GDAL 1.9 or above, what are you on?

-Andy
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: PDF output with layers

Carlos Ruiz
Hey Andy,

The PDF file is not empty, it shows both raster and vector layers. The -mdd LAYERS does not show layers info. I am using MS4W 3.1.3 which, according to the MS4W site has GDAL 2.0.2


On Monday, September 4, 2017, 9:33:07 AM CDT, Andy Colson <[hidden email]> wrote:


On 09/04/2017 09:20 AM, Carlos Ruiz wrote:

> I'm currently exploring PDF generation from Mapserver and I have noticed that no layers appear to be toggled. First I thought this was because the layer CLASS section has no name (as it happens when legend is generated), but it is not.
>
> gdalinfo test.pdf does not show layers information.
>
> Does anybody know how to configure a MAP file to include layers in the PDF output ?
>
> Here is test.map contents:
>
> MAP
>
>      NAME "test"
>      EXTENT 657024 2277645 687240 2294128
>      SIZE 800 600
>
>      OUTPUTFORMAT
>          NAME "pdf"
>          DRIVER CAIRO/PDF
>          MIMETYPE "application/x-pdf"
>          IMAGEMODE RGB
>          EXTENSION "pdf"
>          FORMATOPTION "GEO_ENCODING=ISO32000"
>      END
>
>      PROJECTION
>          "init=EPSG:32613"
>      END
>
>      STATUS ON
>
>      LAYER
>          NAME "Landsat 8"
>          CONNECTION "http://localhost/cgi-bin/landsat8.exe"
>          CONNECTIONTYPE WMS
>          TYPE RASTER
>          STATUS ON
>          METADATA
>              "wms_name" "Landsat 8"
>              "wms_srs" "EPSG:32613"
>              "wms_server_version" "1.0.0"
>              "wms_format" "image/jpeg"
>          END
>      END
>
>      LAYER
>          NAME "Colonias"
>          CONNECTION "..."
>          CONNECTIONTYPE POSTGIS
>          DATA "geom FROM colonias_amg"
>          TYPE POLYGON
>          CLASS
>              NAME "Colonias"
>              STYLE
>                  COLOR 255 200 150
>                  OUTLINECOLOR 0 0 0
>              END
>          END
>          COMPOSITE
>              OPACITY 35
>          END
>          STATUS ON
>      END
>
> END
>
> Thanks in advance

>


How does the pdf look?  Is it empty?

This page:
http://www.gdal.org/frmt_pdf.html

shows the example:

> gdalinfo adobe_style_geospatial.pdf -mdd LAYERS


Does the extra "-mdd LAYERS" help?

Looks like you need GDAL 1.9 or above, what are you on?

-Andy


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: PDF output with layers

Andy Colson
On 09/04/2017 09:43 AM, Carlos Ruiz wrote:
> Hey Andy,
>
> The PDF file is not empty, it shows both raster and vector layers. The -mdd LAYERS does not show layers info. I am using MS4W 3.1.3 which, according to the MS4W site has GDAL 2.0.2
>
>

I see, on that same page:
http://www.gdal.org/frmt_pdf.html

That different pdf libraries have different possibilities (section "Build dependencies").  I'm not sure how to tell which pdf lib its using though.

And section: "LAYERS Metadata domain", it says:
> Starting with GDAL >= 1.10.0 and when GDAL is compiled against Poppler or PDFium, the LAYERS metadata domain can be queried to retrieve layer names

I dunno, maybe.  I'm guessing.

-Andy
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users