Updated OCCI (markdown)
parent
31344a6e14
commit
aab127f473
1 changed files with 22 additions and 21 deletions
43
OCCI.md
43
OCCI.md
|
@ -50,21 +50,21 @@ Make sure you have compat-libstdc++-33 installed.
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
|| *parameter* || *value* || *description* || *default* ||
|
| *parameter* | *value* | *description* | *default* |
|
||||||
|| host || string || name of the oracle host || ||
|
|:------------------|----------|---------------|----------:|
|
||||||
|| user || string || username to use for connecting || ||
|
| host | string | name of the oracle host | |
|
||||||
|| password || string || user password to use for connecting || ||
|
| user | string | username to use for connecting | |
|
||||||
|| table || string || name of the table to fetch, this can be a sub-query || ||
|
| password | string | user password to use for connecting | |
|
||||||
|| geometry_field || string || name of the geometry field, in case you have more than one in a single table || GEOLOC ||
|
| table | string | name of the table to fetch, this can be a sub-query | |
|
||||||
|| extent || string || maxextent of the geometries || determined by querying the oracle metadata for the table ||
|
| geometry_field | string | name of the geometry field, in case you have more than one in a single table | GEOLOC |
|
||||||
|| row_limit || integer || max number of rows to return when querying data, 0 means no limit || 0 ||
|
| extent | string | maxextent of the geometries | determined by querying the oracle metadata for the table |
|
||||||
|| row_prefetch || integer || number of rows to prefetch from the query before converting them to mapnik features (this allows to finetune the balance between transfer time and conversion time) || 1000 ||
|
| row_limit | integer | max number of rows to return when querying data, 0 means no limit | 0 |
|
||||||
|| initial_size || integer || initial size of the stateless connection pool || 1 ||
|
| row_prefetch | integer | number of rows to prefetch from the query before converting them to mapnik features (this allows to finetune the balance between transfer time and conversion time) | 1000 |
|
||||||
|| max_size || integer || max size of the stateless connection pool || 10 ||
|
| initial_size | integer | initial size of the stateless connection pool | 1 |
|
||||||
|| use_spatial_index || boolean || choose wheter to use the oracle spatial index when fetching data || true ||
|
| max_size | integer | max size of the stateless connection pool | 10 |
|
||||||
|| multiple_geometries || boolean || wheter to use multiple different objects or a single one when dealing with multi-objects (this is mainly related to how the label are used in the map, one label for a multi-polygon or one label for each polygon of a multi-polygon)|| false ||
|
| use_spatial_index | boolean | choose wheter to use the oracle spatial index when fetching data | true |
|
||||||
|| encoding || string || internal file encoding || utf-8 ||
|
| multiple_geometries | boolean | wheter to use multiple different objects or a single one when dealing with multi-objects (this is mainly related to how the label are used in the map, one label for a multi-polygon or one label for each polygon of a multi-polygon)| false |
|
||||||
|
| encoding | string | internal file encoding | utf-8 |
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -72,16 +72,17 @@ Make sure you have compat-libstdc++-33 installed.
|
||||||
|
|
||||||
Instantiate a datasource like:
|
Instantiate a datasource like:
|
||||||
|
|
||||||
#!python
|
```python
|
||||||
lyr = Layer('Geometry from Oracle Spatial')
|
lyr = Layer('Geometry from Oracle Spatial')
|
||||||
lyr.datasource = OCCI(host='localhost',user='scott',password='tiger',table='worldborders',geometry_field='geom')
|
lyr.datasource = OCCI(host='localhost',user='scott',password='tiger',table='worldborders',geometry_field='geom')
|
||||||
|
```
|
||||||
|
|
||||||
### XML
|
### XML
|
||||||
|
|
||||||
If you are using XML mapfiles to style your data, then using a Oracle datasource looks like:
|
If you are using XML mapfiles to style your data, then using a Oracle datasource looks like:
|
||||||
|
|
||||||
|
|
||||||
#!xml
|
```xml
|
||||||
<Layer name="countries" status="on" srs="+proj=latlong +datum=WGS84">
|
<Layer name="countries" status="on" srs="+proj=latlong +datum=WGS84">
|
||||||
<StyleName>countries_style_label</StyleName>
|
<StyleName>countries_style_label</StyleName>
|
||||||
<Datasource>
|
<Datasource>
|
||||||
|
@ -94,7 +95,7 @@ If you are using XML mapfiles to style your data, then using a Oracle datasource
|
||||||
<Parameter name="extent">-180,-90,180,89.99</Parameter>
|
<Parameter name="extent">-180,-90,180,89.99</Parameter>
|
||||||
</Datasource>
|
</Datasource>
|
||||||
</Layer>
|
</Layer>
|
||||||
|
```
|
||||||
|
|
||||||
### C++
|
### C++
|
||||||
|
|
||||||
|
@ -102,8 +103,7 @@ Plugin datasource initialization example code can be found on PluginArchitecture
|
||||||
|
|
||||||
A OCCI datasource may be created as follows:
|
A OCCI datasource may be created as follows:
|
||||||
|
|
||||||
|
```cpp
|
||||||
#!C
|
|
||||||
{
|
{
|
||||||
parameters p;
|
parameters p;
|
||||||
p["type"]="occi";
|
p["type"]="occi";
|
||||||
|
@ -118,4 +118,5 @@ A OCCI datasource may be created as follows:
|
||||||
set_datasource(datasource_cache::instance()->create(p));
|
set_datasource(datasource_cache::instance()->create(p));
|
||||||
lyr.add_style("worldborders");
|
lyr.add_style("worldborders");
|
||||||
m.addLayer(lyr);
|
m.addLayer(lyr);
|
||||||
}
|
}
|
||||||
|
```
|
Loading…
Reference in a new issue