Letzte Änderung:  
29.03.2010 13:10:12
 
ein Counter...
Anmelden
  Dokumentation - [Beispielskripten] - [WFS Ausgabe]  
Bild Über IWAN
Bild Das Produkt
Bild ein wenig Technik
Bild Referenzen
Bild Open GIS
Bild History
Bild Aktuelle Änderungen

Bild Dokumentation
Bild Datenzugriff
Bild IwanScript
Bild Symbole und Klassifikation
Bild How-To's
Bild Beispielskripten
PixelBild Layerinfo
PixelBild Projektinfo
PixelBild ReversDns
PixelBild Symboldump
PixelBild WFS Ausgabe

Bild Kontakt/Impressum
Bild Kontakt
Bild Impressum
Bild Haftungsausschluss
Bild Copyright
Bild Weitere Links

 

WFS Ausgabe

Go;
    Call "main";
    // ---------------------------------------------------#-
    // main
    // ---------------------------------------------------#-
    routine "main";
    
        ret=CreateObject(response,"RESPONSE");
        ret=response.SendContinue();
        response.SetHeader("ContentType","text/xml");
        ret=CreateObject(geom,"Geometry");
        ret=CreateSession();
        prj=iif(isNull($PROJECT),"bau",$PROJECT);
        prjSrs=31469;//server.GetProjection(GetActiveProject());
        ret=SetActiveProject(prj);
        if(Compare(GetActiveProject(),prj,EQ));
            ret=CreateObject(server,"SERVER");
            ret=CreateObject(request,"REQUEST");
            ret=CreateObject(wfs,"WFSREQUEST");
            
            // den BaseUrl bestimmen
            if (Compare(Len(request.Referer),0,EQ));
                sBaseUrl=printf("%s://%s%s",request.Protocol(),request.Host(),request.Url());
            else;
                sBaseUrl=request.Referer();
            endif;
            
            if (wfs.ParseRequest());
                if (Compare(wfs.Request,"GetCapabilities",EQ));
                    Call "GetCapabilities";
                endif;
                if (Compare(wfs.Request,"DescribeFeatureType",EQ));
                    Call "DescribeFeatureType";
                endif;
                if (Compare(wfs.Request,"GetFeature",EQ));
                    Call "GetFeature";
                endif;
            else;
                ret=CreateObject(exception,"OGCServiceException");
                ret=exception.Add("INVALID OR EMPTY REQUEST: "+wfs.LastError(),"0x0002","wfs.iws");
                exception.Xml();
            endif;
        else;
            ret=CreateObject(exception,"OGCServiceException");
            ret=exception.Add("SCRIPT: Could not set session or project '"+prj+"' not available","0x0001","wfs.iws");
            exception.Xml();
        endif;
    EndRoutine;
    
    // ---------------------------------------------------#-
    // GetFeature
    // ---------------------------------------------------#-
    routine "GetFeature";
End;<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>Go;
    wfs.RenderToStream();
        if(wfs.LastError!="");
            ret=CreateObject(exception,"OGCServiceException");
            ret=exception.Add("GetFeature: "+wfs.LastError(),"0x0020","wfs.iws");
            exception.Xml();
        endif;
    EndRoutine;
    
    // ---------------------------------------------------#-
    // DescribeFeatureType
    // ---------------------------------------------------#-
    routine "DescribeFeatureType";
End;<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>Go;
        result=wfs.DescribeLayersAsXsd();
        if(wfs.LastError()!="");
            ret=CreateObject(exception,"OGCServiceException");
            ret=exception.Add("DescribeFeatureType: "+wfs.LastError(),"0x0010","wfs.iws");
            exception.Xml();
        else;
            print(result);
        endif;
    EndRoutine;
    
    // ---------------------------------------------------#-
    // GetCapabilities
    // ---------------------------------------------------#-
    routine "GetCapabilities";
End;<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
        <WFS_Capabilities version='1.0.0'
            xmlns='http://www.opengis.net/wfs'
            xmlns:ogc='http://www.opengis.net/ogc'
            xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
            <Service>
                <Name>IWAN WFS MapServer Beta 1</Name>
                <Title>IWAN MapServer</Title>
                <Abstract></Abstract>
                <Keyword></Keyword>
                <OnlineResource>
                    Go;print(sBaseUrl);End;
                </OnlineResource>
                <Fees>NONE</Fees>
                <AccessConstraints>NONE</AccessConstraints>
            </Service>
            <Capability>
                <Request>
                    <GetCapabilities>
                        Go;Call "WriteDCPType";End;
                    </GetCapabilities>
                    <DescribeFeatureType>
                        <SchemaDescriptionLanguage>
                            <XMLSCHEMA />
                        </SchemaDescriptionLanguage>
                        Go;Call "WriteDCPType";End;
                    </DescribeFeatureType>
                    <GetFeature>
                        <ResultFormat>
                            <GML2 />
                        </ResultFormat>
                        Go;Call "WriteDCPType";End;
                    </GetFeature>
                </Request>
            </Capability>
            <FeatureTypeList>
                <Operations>
                    <Query />
                </Operations>
Go;
        ret=CreateObject(layers,"LAYERS");
        if(layers.first());
            while(layers.next()==true);
                layer=layers.GetItem(layers.Item());
                //if(not(InList(layers.item,"L1","L48")));Continue;EndIf;
                if(Compare(layer.ContentType(),"VECTOR",EQ)|Compare(layer.ContentType(),"ANNO",EQ));
End;
                    <FeatureType>
                        <Name>iwan:Go;layer.Name();End;</Name>
                        <Title>Go;HTMLEncode(layer.LayerTitle());End;</Title>
                        <Abstract>Go;HTMLEncode(layer.Description());End;</Abstract>
                        <Keywords>iwan Go;layer.Name();End; Go;HTMLEncode(layer.LayerTitle());End;</Keywords>
                        <SRS>EPSG:Go;print(prjSrs);End;</SRS>
Go;
                    extent=layer.GetExtent();
                    if(extent.Valid&not(extent.Unknown));
                            call "printBBox";
                    endif;
End;                
                    </FeatureType>
Go;
                endif;
            wend;
        endif;
End;
            </FeatureTypeList>
            <ogc:Filter_Capabilities>
                <ogc:Spatial_Capabilities>
                    <ogc:Spatial_Operators>
                        <ogc:Intersect />
                        <ogc:BBOX />
                    </ogc:Spatial_Operators>
                </ogc:Spatial_Capabilities>
                <ogc:Scalar_Capabilities>
                    <ogc:Logical_Operators />
                    <ogc:Comparison_Operators>
                        <ogc:Simple_Comparisons />
                        <ogc:Like />
                    </ogc:Comparison_Operators>
                </ogc:Scalar_Capabilities>
            </ogc:Filter_Capabilities>
        </WFS_Capabilities>        
Go;
    EndRoutine;
    
    // ---------------------------------------------------#-
    // WriteDCPType
    // ---------------------------------------------------#-
    routine "WriteDCPType";
        sUrl=printf("%s?%s",sBaseUrl,wfs.UnusedQueryString);
        sUrl=HTMLEncode(sUrl);
End;
        <DCPType>
            <HTTP>
                <Get onlineResource='Go;print(sUrl);End;' />
                <Post onlineResource='Go;print(sUrl);End;' />
            </HTTP>
        </DCPType>
Go;
    EndRoutine;
//----------------------------------------------------
    routine "printBBox";
//----------------------------------------------------
    strGeom=printf("gBOX:%.5f|%.5f|%.5f|%.5f",extent.Xmin,extent.yMin,extent.XMax,extent.YMax);
    ret=geom.FromGeometry(strGeom);
    ret=geom.Transform(prjSrs,4326);
    ext1=geom.GetExtent();
    printf("<LatLonBoundingBox minx='%.4f' miny='%.4f' maxx='%.4f' maxy='%.4f' />",ext1.Xmin,ext1.yMin,ext1.XMax,ext1.YMax);
    EndRoutine;
End;
Druckersymbol Druckversion dieser Seite 

Zuletzt geändert am 11.04.06 (rn)
Seitenalias: "WFSAusgabe"
   Sitemap | IDU Homepage: [http://www.idu.de] cardo Homepage: [http://www.cardogis.com] GDDB Homepage: [http://www.gddb.de]