Geo-OGC-Service-WFS

 view release on metacpan or  search on metacpan

lib/Geo/OGC/Service/WFS.pm  view on Meta::CPAN

=pod

=head1 NAME

Geo::OGC::Service::WFS - Perl extension for geospatial web feature services

=head1 SYNOPSIS

The process_request method of this module is called by the
Geo::OGC::Service framework.

=head1 DESCRIPTION

This module aims to provide the operations defined by the Open
Geospatial Consortium's Web Feature Service standard. These are (in
the version 2.0 of the standard)

 GetCapabilities (discovery operation) (*)
 DescribeFeatureType (discovery operation) (*)
 GetPropertyValue (query operation)
 GetFeature (query operation) (*)
 GetFeatureWithLock (query & locking operation)
 LockFeature (locking operation)
 Transaction (transaction operation) (*)
 CreateStoredQuery (stored query operation)
 DropStoredQuery (stored query operation)
 ListStoredQueries (stored query operation)
 DescribeStoredQueries (stored query operation)

(*) are at least somehow implemented.

This module is a plugin for the Geo::OGC::Service framework.

=head2 EXPORT

None by default.

=head2 METHODS

=cut

package Geo::OGC::Service::WFS;

use 5.010000; # say // and //=
use feature "switch";
use utf8;
use Carp;
use File::Basename;
use Modern::Perl;
use Capture::Tiny ':all';
use Clone 'clone';
use JSON;
use DBI;
use Geo::GDAL;
use HTTP::Date;
use File::MkTemp;

use Data::Dumper;
use XML::LibXML::PrettyPrint;

use Geo::OGC::Service;
use Geo::OGC::Service::Filter ':all';
use vars qw(@ISA);
push @ISA, qw(Geo::OGC::Service::Filter);

our $VERSION = '0.11';

# GDAL and PostgreSQL data type to XML data type
our %type_map = (
    Short => "xs:short",
    Integer => "xs:integer",
    Integer64 => "xs:long",
    Real => "xs:double",
    integer => "xs:integer",
    int => "xs:integer",
    bigint => "xs:long",
    decimal => "xs:decimal",
    numeric => "xs:decimal",
    real => "xs:float",
    double => "xs:double",
    "double precision" => "xs:decimal",
    timestamp => "xs:date",
    "timestamp with time zone" => "xs:date",
    date => "xs:date",
    time => "xs:time",
    "time with time zone" => "xs:time",
    boolean => "xs:boolean",
);

our %well_known_w3_ns = (
    'xmlns:xlink' => "http://www.w3.org/1999/xlink",
    'xmlns:xs'    => "http://www.w3.org/2001/XMLSchema",
    'xmlns:xsi'   => "http://www.w3.org/2001/XMLSchema-instance",
);

our %wfs_1_1_0_ns = (
    %well_known_w3_ns,
    xmlns => "http://www.opengis.net/wfs",
    'xmlns:wfs' => "http://www.opengis.net/wfs",
    'xmlns:gml' => "http://www.opengis.net/gml",
    'xmlns:ows' => "http://www.opengis.net/ows",
    'xmlns:ogc' => "http://www.opengis.net/ogc",
    'xsi:schemaLocation' => "http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
);

our %wfs_2_0_0_ns = (
    %well_known_w3_ns,
    xmlns => "http://www.opengis.net/wfs/2.0",
    'xmlns:wfs' => "http://www.opengis.net/wfs/2.0",



( run in 3.148 seconds using v1.01-cache-2.11-cpan-14f38c9f855 )