Ian Turton, Astun Technology Ltd.
@ijturton
In 2010 the Open Geospatial Consortium (OGC) proposed a new standard called the Table Joining Service
The Table Joining Service enables the publication of tabular information about geographic features, and the joining of these tables to their geographic features so that the information can be mapped or processed in a geographic information system.
Allows the publication of a single geographic base map/dataset and then publication of many different datasets for that geography.
8 years later no one (to my knowledge) has implemented one.
So basically a completely new service and format to carry out a relatively simple task.
Web Processing Service (WPS) - another OGC standard for carrying out arbitrary operations over the web.
So if we:
@Override public Object decode(InputStream input) throws Exception { // this will be deleted for us when the process finishes Resource tmp = resourceManager.getTemporaryResource(".csv"); IOUtils.copy(input, tmp.out()); HashMap<String, Object> params = new HashMap<>(); params.put(CSVDataStoreFactory.FILE_PARAM.key, tmp.file().getAbsoluteFile()); params.put(CSVDataStoreFactory.STRATEGYP.key, "CSVAttributesOnlyStrategy"); CSVDataStore store = (CSVDataStore) DataStoreFinder.getDataStore(params); SimpleFeatureCollection collection = store.getFeatureSource() .getFeatures(); LOGGER.info("read in "+collection.size()+ " features from CSV source"); store.dispose(); return collection; }
@Override public void encode(Object value, OutputStream os) throws Exception { // will be deleted when the process finishes Resource tmp = resourceManager.getTemporaryResource(".csv"); SimpleFeatureCollection collection = (SimpleFeatureCollection) value; HashMap<String, Object> params = new HashMap<>(); params.put(CSVDataStoreFactory.FILE_PARAM.key,tmp.file() .getAbsoluteFile()); params.put(CSVDataStoreFactory.STRATEGYP.key, "CSVAttributesOnlyStrategy"); CSVDataStore store = (CSVDataStore) DataStoreFinder .getDataStore(params); store.createSchema(collection.getSchema()); String name = store.getTypeName().getLocalPart(); Transaction transaction = Transaction.AUTO_COMMIT; SimpleFeatureSource featureSource = store .getFeatureSource(name,transaction ); if(featureSource instanceof FeatureStore) { CSVFeatureStore csvFeatureStore = (CSVFeatureStore)featureSource; csvFeatureStore.addFeatures(collection); } store.dispose(); IOUtils.copy(tmp.in(),os); }
If you use curl to send text to a remote web service, it will remove line feeds if you send the data as ASCII. If you need the line feeds to be present you must use BINARY.
Simple:
STATE_NAME = State
Complex
A.STATE = STATE (Set alias A)
strToLowerCase(State) = strToLowerCase(STATE_NAME) district = substring(0,6,ward) contains(geom,point)
- for each feature
- find the attribute value required in the filter
- substitute this into the filter and run against the other dataset to find the match
- if matched add to output
Thanks to Astun Ltd for funding this work
Space | Forward |
---|---|
Right, Down, Page Down | Next slide |
Left, Up, Page Up | Previous slide |
P | Open presenter console |
H | Toggle this help |