OGR File Reader

From Pyxis public wiki
Jump to: navigation, search



Summary: Use the OGR File Reader process when creating a vector data source that is read by the OGR library.

Input:

  • Geospatial File Path (1 Path) The path of the file to open.
  • Style Path (0 or 1 Path) The path of the file that specifies rules for colouring features in a vector data source. The style specification file must be an XML file, and must follow the Open Geospatial Consortium (OGC) Styled Layer Descriptor (SLD) syntax. An example is provided later in this page. This input is optional. If no style is provided, then the features will be assigned a random colour.
  • Spatial Reference System (1 SRS) An external spatial reference system definition.

Output: Feature Collection , Feature

  • Description: A collection of 1 to many features that may exist in the feature file.

Attributes:

  • Resolution The resolution to navigate to when performing the 'Go To' operation. This value must be between 2 and 37.

Details

When you drag and drop a vector-based data source (such as a .SHP file) into the Library, WorldView automatically creates a pipeline for you including the OGR File Reader process. If the data source was accompanied by a .PRJ file, WorldView reads the information from the .PRJ file to determine where to geolocate the .SHP file. If there is no accompanying .PRJ file, and you attempt to show the .SHP file, WorldView opens the SRS Wizard to prompt you for the required geolocation information, stores it in a Spatial Reference System process, and connects the Spatial Reference System process as an input to the OGR File Reader process.

Example of Style Path File

<StyledLayerDescriptor version="1.0.0">
    <UserLayer>
        <Name>Petawawa Road Vector</Name>
        <UserStyle>
            <Name>Roads</Name>
            <FeatureTypeStyle>
                <Rule>
                    <Name>Unknown</Name>
                    <Title>Unknown</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>UNK</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 56 21 240</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Trans-Canada Highway</Name>
                    <Title>Trans-Canada Highway</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>17,TRANS-CANADA HIGHWAY</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 56 21 240</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Portage Road</Name>
                    <Title>Portage Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>PORTAGE ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 121 21 21</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Race Horse Road</Name>
                    <Title>Unknown</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>RACE HORSE ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 121 255 121</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Survey Lake Road</Name>
                    <Title>Survey Lake Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>SURVEY LAKE ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 121 21 121</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Deluthier Road</Name>
                    <Title>Deluthier Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>DELUTHIER ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 255 0 255</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Mattawa Road</Name>
                    <Title>Mattawa Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>MATTAWA ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 255 255 0</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Middle Road</Name>
                    <Title>Middle Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>MIDDLE ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 255 127 0</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Youngs Lake Road</Name>
                    <Title>Youngs Lake Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>YOUNGS LAKE ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 255 127 127</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Thackray Lake Road</Name>
                    <Title>Thackray Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>THACKRAY ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 127 127 255</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Clement Trail</Name>
                    <Title>Clement Trail</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>CLEMENT TRAIL</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 50 50 0</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Antler Road</Name>
                    <Title>Antler Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>ANTLER ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 50 0 255</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                
                <Rule>
                    <Name>Brindle Road</Name>
                    <Title>Brindle Road</Title>
                    <Filter>
                        <PropertyIsEqualTo>
                            <PropertyName>14 NAM</PropertyName>
                            <Literal>BRINDLE ROAD</Literal>
                        </PropertyIsEqualTo>
                    </Filter>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="Stroke">uint8_t[3] 0 0 255</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
            </FeatureTypeStyle>
        </UserStyle>
    </UserLayer>
</StyledLayerDescriptor>

Of importance in the above XML style is the following chunk of XML:


<Rule>
    <Name>Brindle Road</Name>
    <Title>Brindle Road</Title>
    <Filter>
        <PropertyIsEqualTo>
            <PropertyName>14 NAM</PropertyName>
            <Literal>BRINDLE ROAD</Literal>
        </PropertyIsEqualTo>
    </Filter>
    <LineSymbolizer>
        <Stroke>
            <CssParameter name="Stroke">uint8_t[3] 0 0 255</CssParameter>
        </Stroke>
    </LineSymbolizer>
</Rule>

The above XML specifies that if a feature has the value 'Brindle Road' for the column '14 NAM' it should be coloured with the PYXValue uint8_t[3] 0 0 255.

Personal tools
Namespaces

Variants
Actions
Navigation
Wiki Navigation
Toolbox