Skip to content

Commit

Permalink
geoserver: add "gtfs-db" store & "stops" layer
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Sep 13, 2023
1 parent 0f6cd98 commit a36c190
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ DAGSTER_POSTGRES_PASSWORD=
# todo: find a container-env-var-based solution to configure the Geoserver
# A random password which will be used for our central postgresql database. Should be long and should not contain special signs.
IPL_POSTGRES_PASSWORD=
IPL_GTFS_DB_POSTGRES_PASSWORD=
# Currently we have to adapt this variable manually, to the latest imported GTFS database.
# Run the following command to list all databases within `gtfs-db`:
# docker compose --env-file .env --env-file .env.local exec gtfs-db /bin/sh -c 'env PGPASSWORD="$POSTGRES_PASSWORD" psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -t -c "SELECT datname AS db FROM pg_catalog.pg_database"'
# todo: let gtfs-importer write `IPL_GTFS_DB_POSTGRES_DB`'s value
IPL_GTFS_DB_POSTGRES_DB=gtfs_…
43 changes: 43 additions & 0 deletions etc/geoserver/workspaces/MobiData-BW/gtfs-db/datastore.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<dataStore>
<id>DataStoreInfoImpl--3b38816a:18a8b06ea7a:-7ff5</id>
<name>gtfs-db</name>
<description>imported GTFS data</description>
<type>PostGIS</type>
<enabled>true</enabled>
<workspace>
<id>WorkspaceInfoImpl--48f676ef:18997a59df5:-7ff6</id>
</workspace>
<connectionParameters>
<entry key="schema">api</entry>
<entry key="Evictor run periodicity">300</entry>
<entry key="Max open prepared statements">50</entry>
<entry key="encode functions">true</entry>
<entry key="Batch insert size">1</entry>
<entry key="preparedStatements">false</entry>
<entry key="database">${IPL_GTFS_DB_POSTGRES_DB}</entry>
<entry key="host">gtfs-db</entry>
<entry key="Loose bbox">true</entry>
<entry key="SSL mode">DISABLE</entry>
<entry key="Estimated extends">true</entry>
<entry key="fetch size">1000</entry>
<entry key="Expose primary keys">true</entry>
<entry key="validate connections">true</entry>
<entry key="Support on the fly geometry simplification">true</entry>
<entry key="Connection timeout">20</entry>
<entry key="create database">false</entry>
<entry key="Method used to simplify geometries">FAST</entry>
<entry key="port">5432</entry>
<entry key="passwd">${IPL_GTFS_DB_POSTGRES_PASSWORD}</entry>
<entry key="min connections">1</entry>
<entry key="dbtype">postgis</entry>
<entry key="namespace">mdbw</entry>
<entry key="max connections">10</entry>
<entry key="Evictor tests per run">3</entry>
<entry key="Test while idle">true</entry>
<entry key="user">postgres</entry>
<entry key="Max connection idle time">300</entry>
</connectionParameters>
<__default>false</__default>
<dateCreated>2023-09-12 20:19:22.888 UTC</dateCreated>
<disableOnConnFailure>false</disableOnConnFailure>
</dataStore>
66 changes: 66 additions & 0 deletions etc/geoserver/workspaces/MobiData-BW/gtfs-db/stops/featuretype.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<featureType>
<id>FeatureTypeInfoImpl--3b38816a:18a8b06ea7a:-7ff4</id>
<name>stops</name>
<nativeName>stops</nativeName>
<namespace>
<id>NamespaceInfoImpl--48f676ef:18997a59df5:-7ff5</id>
</namespace>
<title>stops</title>
<keywords>
<string>features</string>
<string>stops</string>
</keywords>
<nativeCRS>GEOGCS[&quot;WGS 84&quot;,
DATUM[&quot;World Geodetic System 1984&quot;,
SPHEROID[&quot;WGS 84&quot;, 6378137.0, 298.257223563, AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],
AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],
PRIMEM[&quot;Greenwich&quot;, 0.0, AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],
UNIT[&quot;degree&quot;, 0.017453292519943295],
AXIS[&quot;Geodetic longitude&quot;, EAST],
AXIS[&quot;Geodetic latitude&quot;, NORTH],
AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]</nativeCRS>
<srs>EPSG:4326</srs>
<nativeBoundingBox>
<minx>7.5113</minx>
<maxx>10.492</maxx>
<miny>47.533</miny>
<maxy>49.792</maxy>
<crs>EPSG:4326</crs>
</nativeBoundingBox>
<latLonBoundingBox>
<minx>7.5113</minx>
<maxx>10.492</maxx>
<miny>47.533</miny>
<maxy>49.792</maxy>
<crs>EPSG:4326</crs>
</latLonBoundingBox>
<projectionPolicy>NONE</projectionPolicy>
<enabled>true</enabled>
<metadata>
<entry key="elevation">
<dimensionInfo>
<enabled>false</enabled>
</dimensionInfo>
</entry>
<entry key="time">
<dimensionInfo>
<enabled>false</enabled>
</dimensionInfo>
</entry>
<entry key="cachingEnabled">false</entry>
</metadata>
<store class="dataStore">
<id>DataStoreInfoImpl--3b38816a:18a8b06ea7a:-7ff5</id>
</store>
<serviceConfiguration>false</serviceConfiguration>
<simpleConversionEnabled>false</simpleConversionEnabled>
<internationalTitle/>
<internationalAbstract/>
<maxFeatures>0</maxFeatures>
<numDecimals>0</numDecimals>
<padWithZeros>false</padWithZeros>
<forcedDecimal>false</forcedDecimal>
<overridingServiceSRS>false</overridingServiceSRS>
<skipNumberMatched>false</skipNumberMatched>
<circularArcPresent>false</circularArcPresent>
</featureType>
17 changes: 17 additions & 0 deletions etc/geoserver/workspaces/MobiData-BW/gtfs-db/stops/layer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<layer>
<name>stops</name>
<id>LayerInfoImpl--3b38816a:18a8b06ea7a:-7ff3</id>
<type>VECTOR</type>
<defaultStyle>
<id>StyleInfoImpl--3b38816a:18a8b06ea7a:-7ff1</id>
</defaultStyle>
<resource class="featureType">
<id>FeatureTypeInfoImpl--3b38816a:18a8b06ea7a:-7ff4</id>
</resource>
<attribution>
<logoWidth>0</logoWidth>
<logoHeight>0</logoHeight>
</attribution>
<dateCreated>2023-09-12 20:27:19.936 UTC</dateCreated>
<dateModified>2023-09-12 20:39:55.865 UTC</dateModified>
</layer>

0 comments on commit a36c190

Please sign in to comment.