Re: [JPP-Devel] Adding GeoJSON read/write with JTS
marvelous Ede! GeoJSON is more than a hipster format nowadays ;) stefan On 7/1/16 15:04, edgar.sol...@web.de wrote: > hey Jukka, > > please try r4945 or later. > > ..ede > > On 27.06.2016 11:47, Rahkonen Jukka (MML) wrote: >> Yes, sure, having all as strings is a good start. >> >> >> -Jukka- >> >> edgar soldin wrote: >> >>> Jukka, >>> could you live with all attributes being read as Strings for now? ..ede >> On 27.06.2016 08:35, Jukka Rahkonen wrote: Hi, Json datatypes http://www.tutorialspoint.com/json/json_data_types.htm do not map perfectly with OJ datatypes. Strings can be separated from numbers, though, but there is another problem in missing schema. Each feature can have different attributes. I believe that GDAL is scanning the GeoJSON file twice for finding all the attributes which appear in the data and analyzing their datatypes. Rather often GeoJSON is converted from GIS data and then schema is fixed so that all features have same set of attributes and empty ones are marked as NULL. Still it is hard to know the type of attribute if it is NULL. Code for reading GeoJSON with GeoTools is at https://github.com/geotools/geotools/tree/master/modules/unsupported/g eojson An easy start could be to read the first one feature and build schema with attribute types double, string, boolean. But what to do if there are null values? Read first hundred? Read until first not null? Or let user make a header line with schema into a separate file "basename.jsont" like with the GDAL CSV driver http://www.gdal.org/drv_csv.html attr_1:string;attr_2:integer;attr_3:double Sorry that I can't give simple answers, I thought it would be easier and handled by JTS already. -Jukka- edgar.sol...@web.de kirjoitti 2016-06-26 17:19: > hey Jukka, > > attributes do not seem to carry a type in GeoJSON.. any idea how this > is supposed to be parsed? > > ..ede > > On 23.06.2016 16:20, Jukka Rahkonen wrote: >> Hi Ede, >> >> Please find attached. I included some small samples in both JML and >> GeoJSON. For the conversion I used ogr2ogr: >> >> ogr2ogr -f geojson output.json input.jml >> >> Test data is not perfect: >> >> - I just digitized some features and they may be outside the real >> area of the EPSG:4326 which is default in GeoJSON (-90,-180,90,180) >> - GDAL warned that DateTime type is not natively supported >> >> For handling projections with ogr2ogr use source and target srs >> parameters as >> >> ogr2ogr -f geojson -s_srs epsg:3067 -t_srs epsg:4326 output.json >> input.jml >> >> -Jukka- >> >> edgar.sol...@web.de kirjoitti 2016-06-23 15:56: >>> Jukka, >>> >>> do you have an example dataset to tiner with for me? >>> >>> ..ede >> -- >> Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San >> Francisco, CA to explore cutting-edge tech and listen to tech luminaries >> present their vision of the future. This family event has something for >> everyone, including kids. Get more information and register today. >> http://sdm.link/attshape >> ___ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> >> -- >> Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San >> Francisco, CA to explore cutting-edge tech and listen to tech luminaries >> present their vision of the future. This family event has something for >> everyone, including kids. Get more information and register today. >> http://sdm.link/attshape >> ___ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> > -- > Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for > everyone, including kids. Get more information and register today. > http://sdm.link/attshape > ___ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the
Re: [JPP-Devel] Adding GeoJSON read/write with JTS
hey Jukka, please try r4945 or later. ..ede On 27.06.2016 11:47, Rahkonen Jukka (MML) wrote: > Yes, sure, having all as strings is a good start. > > > -Jukka- > > edgar soldin wrote: > >> Jukka, > >> could you live with all attributes being read as Strings for now? ..ede > > On 27.06.2016 08:35, Jukka Rahkonen wrote: >>> Hi, >>> >>> Json datatypes http://www.tutorialspoint.com/json/json_data_types.htm do >>> not map perfectly with OJ datatypes. Strings can be separated from numbers, >>> though, but there is another problem in missing schema. Each feature can >>> have different attributes. >>> >>> I believe that GDAL is scanning the GeoJSON file twice for finding all the >>> attributes which appear in the data and analyzing their datatypes. Rather >>> often GeoJSON is converted from GIS data and then schema is fixed so that >>> all features have same set of attributes and empty ones are marked as NULL. >>> Still it is hard to know the type of attribute if it is NULL. >>> >>> Code for reading GeoJSON with GeoTools is at >>> https://github.com/geotools/geotools/tree/master/modules/unsupported/g >>> eojson >>> >>> An easy start could be to read the first one feature and build schema >>> with attribute types double, string, boolean. But what to do if there >>> are null values? Read first hundred? Read until first not null? Or let >>> user make a header line with schema into a separate file >>> "basename.jsont" like with the GDAL CSV driver >>> http://www.gdal.org/drv_csv.html >>> >>> attr_1:string;attr_2:integer;attr_3:double >>> >>> Sorry that I can't give simple answers, I thought it would be easier and >>> handled by JTS already. >>> >>> -Jukka- >>> >>> edgar.sol...@web.de kirjoitti 2016-06-26 17:19: hey Jukka, attributes do not seem to carry a type in GeoJSON.. any idea how this is supposed to be parsed? ..ede On 23.06.2016 16:20, Jukka Rahkonen wrote: > Hi Ede, > > Please find attached. I included some small samples in both JML and > GeoJSON. For the conversion I used ogr2ogr: > > ogr2ogr -f geojson output.json input.jml > > Test data is not perfect: > > - I just digitized some features and they may be outside the real > area of the EPSG:4326 which is default in GeoJSON (-90,-180,90,180) > - GDAL warned that DateTime type is not natively supported > > For handling projections with ogr2ogr use source and target srs > parameters as > > ogr2ogr -f geojson -s_srs epsg:3067 -t_srs epsg:4326 output.json > input.jml > > -Jukka- > > edgar.sol...@web.de kirjoitti 2016-06-23 15:56: >> Jukka, >> >> do you have an example dataset to tiner with for me? >> >> ..ede > > -- > Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for > everyone, including kids. Get more information and register today. > http://sdm.link/attshape > ___ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > -- > Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for > everyone, including kids. Get more information and register today. > http://sdm.link/attshape > ___ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
[JPP-Devel] SVN: [4945] core/trunk/pom.xml
Revision: 4945 http://sourceforge.net/p/jump-pilot/code/4945 Author: edso Date: 2016-07-01 17:06:24 + (Fri, 01 Jul 2016) Log Message: --- leftover from geojson commit Modified Paths: -- core/trunk/pom.xml Modified: core/trunk/pom.xml === --- core/trunk/pom.xml 2016-07-01 15:36:23 UTC (rev 4944) +++ core/trunk/pom.xml 2016-07-01 17:06:24 UTC (rev 4945) @@ -766,6 +766,11 @@ 1.14.0 +com.vividsolutions +jts-io +1.14.0 + + org.beanshell bsh 2.0b4 @@ -944,5 +949,10 @@ org-netbeans-swing-outline 7.2 + + com.googlecode.json-simple + json-simple + 1.1.1 + -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Feature Info panel and feature selection
I kind of agree stefan On 7/1/16 07:14, Nicolas Ribot wrote: Ok, I see this discussion: "LayerView/AttributeTable selection synchronization" and in the code, I see a attributeTable is used in FeatureInfoPanel. Could an option be added to OJ to control the attributeTable selection ? IMO, previous behaviour was fine: select row(s), then decide if you want a map selection or not. Defaulting to feature flashing when a row is clicked is really handy when debugging spatial features. Nicolas On 1 July 2016 at 12:02, Nicolas Ribot> wrote: Hi all, The current behaviour for Feature Info panel is different from previous versions: Now, when a Feature Info row is clicked, the corresponding feature is automatically selected. It is not possible to just flash the selected row, as the corresponding feature is selected. Furthermore, when a feature is selected in the map (because its row was clicked on FeatureInfo), then it appears in subsequent Info panel, even if the feature is not part of the info selection set. It is a source of confusion when checking features. Is it possible (or where can it be done) to add an option to keep old mechanism: clicking on a row flashes the feature, clicking on the select button selects the feature on the map ? Thanks Nicolas -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
[JPP-Devel] SVN: [4944] core/trunk/ChangeLog
Revision: 4944 http://sourceforge.net/p/jump-pilot/code/4944 Author: edso Date: 2016-07-01 15:36:23 + (Fri, 01 Jul 2016) Log Message: --- update Modified Paths: -- core/trunk/ChangeLog Modified: core/trunk/ChangeLog === --- core/trunk/ChangeLog2016-07-01 15:34:36 UTC (rev 4943) +++ core/trunk/ChangeLog2016-07-01 15:36:23 UTC (rev 4944) @@ -3,6 +3,9 @@ # 2. make sure that lines break at 80 chars for constricted display situations #< 80 chars --># +2016-07-01 ede + * GeoJSON read support added, sponsored by Jukka Rahkonen + 2016-06-23 mmichaud* Fix bug #420 (many feature labels were lost with svg export) -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
[JPP-Devel] SVN: [4943] core/trunk
Revision: 4943 http://sourceforge.net/p/jump-pilot/code/4943 Author: edso Date: 2016-07-01 15:34:36 + (Fri, 01 Jul 2016) Log Message: --- add GeoJSON read support Modified Paths: -- core/trunk/etc/readme.txt core/trunk/src/com/vividsolutions/jump/io/datasource/StandardReaderWriterFileDataSource.java core/trunk/src/com/vividsolutions/jump/workbench/datasource/InstallStandardDataSourceQueryChoosersPlugIn.java Added Paths: --- core/trunk/lib/json-simple-1.1.1.jar core/trunk/lib/jts-io-1.14.0.jar core/trunk/src/com/vividsolutions/jump/io/GeoJSONConstants.java core/trunk/src/com/vividsolutions/jump/io/GeoJSONReader.java core/trunk/src/com/vividsolutions/jump/io/GeoJSONWriter.java Modified: core/trunk/etc/readme.txt === --- core/trunk/etc/readme.txt 2016-07-01 15:28:42 UTC (rev 4942) +++ core/trunk/etc/readme.txt 2016-07-01 15:34:36 UTC (rev 4943) @@ -52,6 +52,7 @@ JMath and its successor projects JMathTools (IO,Plot,Array) - BSD license - jmath_license.txt Javascript library RHINO - GPL2 - gpl-2.txt + JSON-simple - Apache License Version 2.0 - apache_license-2.0.txt JTS Topology Suite - LGPL2 - lgpl-2.1.txt JUnit - Eclipse Public License v1.0 - epl-v10.txt Jython - Jython license - jython_license.txt Added: core/trunk/lib/json-simple-1.1.1.jar === (Binary files differ) Index: core/trunk/lib/json-simple-1.1.1.jar === --- core/trunk/lib/json-simple-1.1.1.jar2016-07-01 15:28:42 UTC (rev 4942) +++ core/trunk/lib/json-simple-1.1.1.jar2016-07-01 15:34:36 UTC (rev 4943) Property changes on: core/trunk/lib/json-simple-1.1.1.jar ___ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: core/trunk/lib/jts-io-1.14.0.jar === (Binary files differ) Index: core/trunk/lib/jts-io-1.14.0.jar === --- core/trunk/lib/jts-io-1.14.0.jar2016-07-01 15:28:42 UTC (rev 4942) +++ core/trunk/lib/jts-io-1.14.0.jar2016-07-01 15:34:36 UTC (rev 4943) Property changes on: core/trunk/lib/jts-io-1.14.0.jar ___ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: core/trunk/src/com/vividsolutions/jump/io/GeoJSONConstants.java === --- core/trunk/src/com/vividsolutions/jump/io/GeoJSONConstants.java (rev 0) +++ core/trunk/src/com/vividsolutions/jump/io/GeoJSONConstants.java 2016-07-01 15:34:36 UTC (rev 4943) @@ -0,0 +1,7 @@ +package com.vividsolutions.jump.io; + +public class GeoJSONConstants { + public static final String PROPERTIES = "properties"; + public static final String GEOMETRY = "geometry"; + public static final Object FEATURES = "features"; +} Property changes on: core/trunk/src/com/vividsolutions/jump/io/GeoJSONConstants.java ___ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: core/trunk/src/com/vividsolutions/jump/io/GeoJSONReader.java === --- core/trunk/src/com/vividsolutions/jump/io/GeoJSONReader.java (rev 0) +++ core/trunk/src/com/vividsolutions/jump/io/GeoJSONReader.java 2016-07-01 15:34:36 UTC (rev 4943) @@ -0,0 +1,331 @@ +package com.vividsolutions.jump.io; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Stack; +import java.util.Vector; + +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.json.simple.parser.ContainerFactory; +import org.json.simple.parser.ContentHandler; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.io.geojson.GeoJsonConstants; +import com.vividsolutions.jts.io.geojson.GeoJsonReader; +import com.vividsolutions.jump.feature.AttributeType; +import com.vividsolutions.jump.feature.BasicFeature; +import
[JPP-Devel] SVN: [4942] core/trunk/src/com/vividsolutions/jump/io/datasource/ ReaderWriterFileDataSource.java
Revision: 4942 http://sourceforge.net/p/jump-pilot/code/4942 Author: edso Date: 2016-07-01 15:28:42 + (Fri, 01 Jul 2016) Log Message: --- fix tabs Modified Paths: -- core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java Modified: core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java === --- core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java 2016-06-26 12:28:56 UTC (rev 4941) +++ core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java 2016-07-01 15:28:42 UTC (rev 4942) @@ -63,7 +63,7 @@ try { FeatureCollection fc = reader.read(getReaderDriverProperties()); exceptions.addAll(reader.getExceptions()); - return fc; +return fc; } catch (Exception e) { exceptions.add(e); return null; -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Feature Info panel and feature selection
Ok, I see this discussion: "LayerView/AttributeTable selection synchronization" and in the code, I see a attributeTable is used in FeatureInfoPanel. Could an option be added to OJ to control the attributeTable selection ? IMO, previous behaviour was fine: select row(s), then decide if you want a map selection or not. Defaulting to feature flashing when a row is clicked is really handy when debugging spatial features. Nicolas On 1 July 2016 at 12:02, Nicolas Ribotwrote: > Hi all, > > The current behaviour for Feature Info panel is different from previous > versions: > Now, when a Feature Info row is clicked, the corresponding feature is > automatically selected. > It is not possible to just flash the selected row, as the corresponding > feature is selected. > > Furthermore, when a feature is selected in the map (because its row was > clicked on FeatureInfo), then it appears in subsequent Info panel, even if > the feature is not part of the info selection set. It is a source of > confusion when checking features. > > Is it possible (or where can it be done) to add an option to keep old > mechanism: clicking on a row flashes the feature, clicking on the select > button selects the feature on the map ? > > Thanks > > Nicolas > -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
[JPP-Devel] Feature Info panel and feature selection
Hi all, The current behaviour for Feature Info panel is different from previous versions: Now, when a Feature Info row is clicked, the corresponding feature is automatically selected. It is not possible to just flash the selected row, as the corresponding feature is selected. Furthermore, when a feature is selected in the map (because its row was clicked on FeatureInfo), then it appears in subsequent Info panel, even if the feature is not part of the info selection set. It is a source of confusion when checking features. Is it possible (or where can it be done) to add an option to keep old mechanism: clicking on a row flashes the feature, clicking on the select button selects the feature on the map ? Thanks Nicolas -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel