GIS support for Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

GIS support for Pharo

SergeStinckwich
Dear all,

there was already some discussion in the list about GIS support for Pharo previously.

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

I know of existing GIS software:
- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON
- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster
- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes
(to be moved to github)
- I found this project also: http://www.squeaksource.com/gekon.html

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?

Cheers,
--
Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

NorbertHartl
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

Norbert

[4] https://github.com/pharo-contributions/Geometry

Am 04.06.2020 um 05:31 schrieb Serge Stinckwich <[hidden email]>:

Dear all,

there was already some discussion in the list about GIS support for Pharo previously.

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

I know of existing GIS software:
- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON
- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster
- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes
(to be moved to github)
- I found this project also: http://www.squeaksource.com/gekon.html

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?

Cheers,
--

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

NorbertHartl
Forgot to say. I also started to do an OSM renderer two years ago. 


I tried to do in Bloc but got no support and it got stuck. A few weeks ago I put this again on my list. Talking to Stef I saw that I might not need to interaction support etc. at the beginning and can do this on top of Athens. 

FYI,

Norbert
Am 04.06.2020 um 10:11 schrieb Norbert Hartl <[hidden email]>:

I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

Norbert

[4] https://github.com/pharo-contributions/Geometry

Am 04.06.2020 um 05:31 schrieb Serge Stinckwich <[hidden email]>:

Dear all,

there was already some discussion in the list about GIS support for Pharo previously.

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

I know of existing GIS software:
- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON
- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster
- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes
(to be moved to github)
- I found this project also: http://www.squeaksource.com/gekon.html

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?

Cheers,
--


Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

Hans Baveco
In reply to this post by SergeStinckwich

Would be an interesting project..

An old link to possibly still useful code:

 

http://wiki.squeak.org/squeak/3317

 

 

Btw the shapefile support, from the ESRI spec, was done by me and is still available on http://www.squeaksource.com/@CUT95k_uXmPU4uXY/HCmgtrop. I use it daily. I may have some fixes/additions, but in general the code as provided works well (I suppose the code at smalltalkhub is still mostly the same). Some shapefile formats are still missing, mostly because I never encountered them..

To read a complete shapefile one also needs to read dbf files. This was another substantial effort http://www.squeaksource.com/@Y4HhnL90iyA2TmAb/X0sPqshM; luckily  there was an older implementation.available to build upon.

Not sure whether nowadays there are other ways to read/write files old DBASE format files...

 

Cheers,

 

Hans Baveco

 

 

 

 

From: Serge Stinckwich <[hidden email]>
Sent: donderdag 4 juni 2020 5:32
To: Any question about pharo is welcome <[hidden email]>
Subject: [Pharo-users] GIS support for Pharo

 

Dear all,

 

there was already some discussion in the list about GIS support for Pharo previously.

 

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

 

I know of existing GIS software:

- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON

- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster

- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes

(to be moved to github)

- I found this project also: http://www.squeaksource.com/gekon.html

 

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

 

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?


Cheers,

--

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

cedreek
In reply to this post by NorbertHartl
Looks great and all information in the thread.

….
- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

<Slighty OT>, What do you think of Mapbox ? I try to de-google as much as I can :)

Just to contextualize: 
my mid-term goal is to have a mean to build simple « digital twin » that are integrated in Mapbox/Leaflet/OSM, using a priori three.js. 
Spatiality is a bit tricky as not default in three.js and the three.js plugin of Mapbox is a bit limited as far a I understand it right now (I’m trying stuff on that especially with the reytracing possibility so as to augment 3D models).

There is a lib called maptalks where I put the demo here.


This is the building block for interactive geospatial 3D model I experiment with the help of students.

</sligthy OT>

The "digital twin » might be OT from the GIS related effort that is discussed here but I find it very related. 
If you want a digital twin, it has to be geolocalized. Tell me if other have such kind of interest.



- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

Cool :)


- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

...


- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages

Great :)



So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

I think the projection system is one of the hard difficulties with GIS but also important. It’s out of my knowledge but probably people like Etienne can give their impression on that ?


Cheers and thanks again for all the efforts,

Cédrick


For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

Norbert

[4] https://github.com/pharo-contributions/Geometry

Am 04.06.2020 um 05:31 schrieb Serge Stinckwich <[hidden email]>:

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

SergeStinckwich
In reply to this post by NorbertHartl


On Thu, Jun 4, 2020 at 4:11 PM Norbert Hartl <[hidden email]> wrote:
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:


Thank you Norbert for your interest on that topic.
I put Etienne Delay because he is not ont the pharo-users mailing-list and I'm working with him on GIS issues for CORMAS.

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages


You have done a lot of work. And we add all the work done by Hernan on supporting ESRI shapefiles, we have already a good start.

Etienne also mention the OpenGIS model in this issue:

From what I understood, OpenGIS model crosscut many points of the Geography package:

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

We can try to do an online meeting to discuss about that with Etienne and other people interested by this topic.
We are mostly interested to have GIS support on CORMAS, so having a common repository will definitively help us.
At the moment we are using Roassal2 for CORMAS visualisatin and we are moving towards Roassal3.
Regards,
--
Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

SergeStinckwich
In reply to this post by NorbertHartl
Really nice visualisation !

On Thu, Jun 4, 2020 at 4:45 PM Norbert Hartl <[hidden email]> wrote:
Forgot to say. I also started to do an OSM renderer two years ago. 


I tried to do in Bloc but got no support and it got stuck. A few weeks ago I put this again on my list. Talking to Stef I saw that I might not need to interaction support etc. at the beginning and can do this on top of Athens. 

FYI,

Norbert
Am 04.06.2020 um 10:11 schrieb Norbert Hartl <[hidden email]>:

I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

Norbert

[4] https://github.com/pharo-contributions/Geometry

Am 04.06.2020 um 05:31 schrieb Serge Stinckwich <[hidden email]>:

Dear all,

there was already some discussion in the list about GIS support for Pharo previously.

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

I know of existing GIS software:
- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON
- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster
- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes
(to be moved to github)
- I found this project also: http://www.squeaksource.com/gekon.html

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?

Cheers,
--




--
Serge Stinckwic
​h​
https://twitter.com/SergeStinckwich
Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

NorbertHartl
In reply to this post by SergeStinckwich


Am 04.06.2020 um 12:31 schrieb Serge Stinckwich <[hidden email]>:



On Thu, Jun 4, 2020 at 4:11 PM Norbert Hartl <[hidden email]> wrote:
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:


Thank you Norbert for your interest on that topic.
I put Etienne Delay because he is not ont the pharo-users mailing-list and I'm working with him on GIS issues for CORMAS.

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages


You have done a lot of work. And we add all the work done by Hernan on supporting ESRI shapefiles, we have already a good start.

Etienne also mention the OpenGIS model in this issue: 

From what I understood, OpenGIS model crosscut many points of the Geography package:

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

We can try to do an online meeting to discuss about that with Etienne and other people interested by this topic.
We are mostly interested to have GIS support on CORMAS, so having a common repository will definitively help us.
At the moment we are using Roassal2 for CORMAS visualisatin and we are moving towards Roassal3.

Good idea! I just created the Geography package because I felt the need for it. But if there is something better I would like to use this instead. I'm generally available the best at wednesdays and thursdays. Next week is already stuffed but if you propose some DateAndTimes I'm sure we find a match. Which timezone are you in at the moment?

Norbert

Regards,
-- 

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

SergeStinckwich
OpenGIS is an object-oriented meta-model for GIS. There is no implementation in Pharo but can give a good blueprint if we want to do something like that.

I’m GMT+8. So a meeting Thursday at 9am for you is great for me (2pm for me).
It would be nice if Hernan can join also, but might be difficult with the time zone difference.

Regards,

Sent from my iPad

On 4 Jun 2020, at 18:50, Norbert Hartl <[hidden email]> wrote:



Am 04.06.2020 um 12:31 schrieb Serge Stinckwich <[hidden email]>:



On Thu, Jun 4, 2020 at 4:11 PM Norbert Hartl <[hidden email]> wrote:
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:


Thank you Norbert for your interest on that topic.
I put Etienne Delay because he is not ont the pharo-users mailing-list and I'm working with him on GIS issues for CORMAS.

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages


You have done a lot of work. And we add all the work done by Hernan on supporting ESRI shapefiles, we have already a good start.

Etienne also mention the OpenGIS model in this issue: 

From what I understood, OpenGIS model crosscut many points of the Geography package:

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

We can try to do an online meeting to discuss about that with Etienne and other people interested by this topic.
We are mostly interested to have GIS support on CORMAS, so having a common repository will definitively help us.
At the moment we are using Roassal2 for CORMAS visualisatin and we are moving towards Roassal3.

Good idea! I just created the Geography package because I felt the need for it. But if there is something better I would like to use this instead. I'm generally available the best at wednesdays and thursdays. Next week is already stuffed but if you propose some DateAndTimes I'm sure we find a match. Which timezone are you in at the moment?

Norbert

Regards,
-- 

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

hernanmd


El jue., 4 jun. 2020 a las 9:16, Serge Stinckwich (<[hidden email]>) escribió:
OpenGIS is an object-oriented meta-model for GIS. There is no implementation in Pharo but can give a good blueprint if we want to do something like that.

I’m GMT+8. So a meeting Thursday at 9am for you is great for me (2pm for me).
It would be nice if Hernan can join also, but might be difficult with the time zone difference.


You mean next Thursday 11/06 ?
On discord cormas channel?
I could connect no problem.

Cheers,

Hernán

 
Regards,

Sent from my iPad

On 4 Jun 2020, at 18:50, Norbert Hartl <[hidden email]> wrote:



Am 04.06.2020 um 12:31 schrieb Serge Stinckwich <[hidden email]>:



On Thu, Jun 4, 2020 at 4:11 PM Norbert Hartl <[hidden email]> wrote:
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:


Thank you Norbert for your interest on that topic.
I put Etienne Delay because he is not ont the pharo-users mailing-list and I'm working with him on GIS issues for CORMAS.

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages


You have done a lot of work. And we add all the work done by Hernan on supporting ESRI shapefiles, we have already a good start.

Etienne also mention the OpenGIS model in this issue: 

From what I understood, OpenGIS model crosscut many points of the Geography package:

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

We can try to do an online meeting to discuss about that with Etienne and other people interested by this topic.
We are mostly interested to have GIS support on CORMAS, so having a common repository will definitively help us.
At the moment we are using Roassal2 for CORMAS visualisatin and we are moving towards Roassal3.

Good idea! I just created the Geography package because I felt the need for it. But if there is something better I would like to use this instead. I'm generally available the best at wednesdays and thursdays. Next week is already stuffed but if you propose some DateAndTimes I'm sure we find a match. Which timezone are you in at the moment?

Norbert

Regards,
-- 

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

NorbertHartl
In reply to this post by SergeStinckwich


Am 04.06.2020 um 14:15 schrieb Serge Stinckwich <[hidden email]>:

OpenGIS is an object-oriented meta-model for GIS. There is no implementation in Pharo but can give a good blueprint if we want to do something like that.

I’m GMT+8. So a meeting Thursday at 9am for you is great for me (2pm for me).
It would be nice if Hernan can join also, but might be difficult with the time zone difference.

If you could shift that to one hour later would be good. If it is a problem for Hernan I try to convince my family but later is better.

Norbert

Regards,

Sent from my iPad

On 4 Jun 2020, at 18:50, Norbert Hartl <[hidden email]> wrote:



Am 04.06.2020 um 12:31 schrieb Serge Stinckwich <[hidden email]>:



On Thu, Jun 4, 2020 at 4:11 PM Norbert Hartl <[hidden email]> wrote:
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:


Thank you Norbert for your interest on that topic.
I put Etienne Delay because he is not ont the pharo-users mailing-list and I'm working with him on GIS issues for CORMAS.

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages


You have done a lot of work. And we add all the work done by Hernan on supporting ESRI shapefiles, we have already a good start.

Etienne also mention the OpenGIS model in this issue: 

From what I understood, OpenGIS model crosscut many points of the Geography package:

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

We can try to do an online meeting to discuss about that with Etienne and other people interested by this topic.
We are mostly interested to have GIS support on CORMAS, so having a common repository will definitively help us.
At the moment we are using Roassal2 for CORMAS visualisatin and we are moving towards Roassal3.

Good idea! I just created the Geography package because I felt the need for it. But if there is something better I would like to use this instead. I'm generally available the best at wednesdays and thursdays. Next week is already stuffed but if you propose some DateAndTimes I'm sure we find a match. Which timezone are you in at the moment?

Norbert

Regards,
-- 


Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

Stéphane Ducasse
In reply to this post by Hans Baveco
Hi hans 

Are you planning to publish on github or can we do it?
You use it daily on which system? 

S. 


On 4 Jun 2020, at 10:45, Baveco, Hans <[hidden email]> wrote:

Would be an interesting project..
An old link to possibly still useful code:
 
 
 
Btw the shapefile support, from the ESRI spec, was done by me and is still available onhttp://www.squeaksource.com/@CUT95k_uXmPU4uXY/HCmgtrop. I use it daily. I may have some fixes/additions, but in general the code as provided works well (I suppose the code at smalltalkhub is still mostly the same). Some shapefile formats are still missing, mostly because I never encountered them..
To read a complete shapefile one also needs to read dbf files. This was another substantial efforthttp://www.squeaksource.com/@Y4HhnL90iyA2TmAb/X0sPqshM; luckily  there was an older implementation.available to build upon.
Not sure whether nowadays there are other ways to read/write files old DBASE format files...
 
Cheers,
 
Hans Baveco
 
 
 
 
From: Serge Stinckwich <[hidden email]> 
Sent: donderdag 4 juni 2020 5:32
To: Any question about pharo is welcome <[hidden email]>
Subject: [Pharo-users] GIS support for Pharo
 
Dear all,
 
there was already some discussion in the list about GIS support for Pharo previously.
 
Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.
 
I know of existing GIS software:
- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON
- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster
- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes
(to be moved to github)
- I found this project also: http://www.squeaksource.com/gekon.html
 
I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support:https://github.com/cormas/cormas/issues/139
 
Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?

Cheers,
-- 

--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

Stéphane Ducasse
In reply to this post by SergeStinckwich
It would be good to have the related package under an umbrella. 
For example I can spend some time packaging hans package on github but only if it helps. 
So let me know. 

S

On 4 Jun 2020, at 14:15, Serge Stinckwich <[hidden email]> wrote:

OpenGIS is an object-oriented meta-model for GIS. There is no implementation in Pharo but can give a good blueprint if we want to do something like that.

I’m GMT+8. So a meeting Thursday at 9am for you is great for me (2pm for me).
It would be nice if Hernan can join also, but might be difficult with the time zone difference.

Regards,

Sent from my iPad

On 4 Jun 2020, at 18:50, Norbert Hartl <[hidden email]> wrote:



Am 04.06.2020 um 12:31 schrieb Serge Stinckwich <[hidden email]>:



On Thu, Jun 4, 2020 at 4:11 PM Norbert Hartl <[hidden email]> wrote:
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:


Thank you Norbert for your interest on that topic.
I put Etienne Delay because he is not ont the pharo-users mailing-list and I'm working with him on GIS issues for CORMAS.

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages


You have done a lot of work. And we add all the work done by Hernan on supporting ESRI shapefiles, we have already a good start.

Etienne also mention the OpenGIS model in this issue: 

From what I understood, OpenGIS model crosscut many points of the Geography package:

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

We can try to do an online meeting to discuss about that with Etienne and other people interested by this topic.
We are mostly interested to have GIS support on CORMAS, so having a common repository will definitively help us.
At the moment we are using Roassal2 for CORMAS visualisatin and we are moving towards Roassal3.

Good idea! I just created the Geography package because I felt the need for it. But if there is something better I would like to use this instead. I'm generally available the best at wednesdays and thursdays. Next week is already stuffed but if you propose some DateAndTimes I'm sure we find a match. Which timezone are you in at the moment?

Norbert

Regards,
-- 


--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

Ben Coman
In reply to this post by NorbertHartl


On Thu, 4 Jun 2020 at 16:12, Norbert Hartl <[hidden email]> wrote:
I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

I don't know a lot about it, but in trying to learn I bumped into some interesting articles from an Australian perspective... 

 



cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

Pharo Smalltalk Users mailing list
In reply to this post by SergeStinckwich
Hi Serge,

I would love to participate in getting some GIS features into Pharo.  I think it would be a fantastic platform for GIS.

My personal orientation is doing marine navigation (have boat with sensors, want boat to be be smarter about navigation).

My main interests is in being able to render S57/S52 formats.  There are a number of boat fans that balk at the price of expensive chart plotter computers and software.

They have given rise to some DIY stuff.  Some of it just rips code straight out of https://gdal.org - I think possibly a FFI integration with gdal might be an amazing resource.

I am time constrained for when I can work on this stuff but would like it a lot if we at least had some core data types for simple things like lat/lng, regions (polygons), and a decent general map renderer.

Anyhow, please include me in any conversations.  Navigation (both air and sea) are two things I have an interest in.

On Jun 3, 2020, at 8:31 PM, Serge Stinckwich <[hidden email]> wrote:

Dear all,

there was already some discussion in the list about GIS support for Pharo previously.

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

I know of existing GIS software:
- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON
- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster
- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes
(to be moved to github)
- I found this project also: http://www.squeaksource.com/gekon.html

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?

Cheers,
--

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

hernanmd
In reply to this post by Hans Baveco
Hi Hans,


El jue., 4 jun. 2020 a las 6:07, Baveco, Hans (<[hidden email]>) escribió:

Would be an interesting project..

An old link to possibly still useful code:

 

http://wiki.squeak.org/squeak/3317

 

 

Btw the shapefile support, from the ESRI spec, was done by me and is still available on http://www.squeaksource.com/@CUT95k_uXmPU4uXY/HCmgtrop.


Thank you for the clarification (and actually sharing your work with ESRI files!)
I added proper credits in the Github forked repo : https://github.com/hernanmd/Shapes
 

I use it daily. I may have some fixes/additions, but in general the code as provided works well (I suppose the code at smalltalkhub is still mostly the same). Some shapefile formats are still missing, mostly because I never encountered them..


You mean some types are missing? Because I get this error when I try to read some SHP files: "Types > 20 are not yet accounted for"
 
I wrote this script to reproduce:

 | shpE legend urlRoot urlESRIFilePrefix urlESRIFileShp urlPath response fileRef |

" Download Shapefile resources "
urlRoot := 'https://github.com/nvkelso/natural-earth-vector/blob/master/110m_cultural/'.
urlESRIFilePrefix := 'ne_110m_populated_places'.
urlESRIFileShp := urlESRIFilePrefix , '.shp'.
urlPath := urlRoot , urlESRIFilePrefix.

#('.shx' '.dbf' '.shp') do: [ : ext |
| url |
url :=  (urlPath , ext , '?raw=true') asZnUrl.
(response := ZnEasy get: url) isSuccess
ifFalse: [ self error: 'Cannot download file' ].
fileRef := FileSystem disk workingDirectory / (urlESRIFilePrefix , ext).
fileRef writeStreamDo: [ : stream |
stream nextPutAll: ((ZnByteEncoder newForEncoding: 'koi8r') decodeBytes: response contents ) ] ].

Once downloaded:

| urlESRIFilePrefix urlESRIFileShp shpE |
urlESRIFilePrefix := 'ne_110m_populated_places'.
urlESRIFileShp := urlESRIFilePrefix , '.shp'.

" Load and display it in Morphic "
shpE := ShapeEnsemble fromFile: urlESRIFileShp.

Maybe it's related with the fact they are encoded as koi8r?
I checked with Zinc downloading first from the browser:

| shpFile |                                                                            
shpFile := 'ne_110m_admin_0_countries.shp' asFileReference.
[ shpFile binaryReadStreamDo: [ : in |
                (ZnCharacterEncoder detectEncoding: in upToEnd) identifier ] ]
        on: ZnCharacterEncodingError
        do: [ nil ].


Cheers,

Hernán

To read a complete shapefile one also needs to read dbf files. This was another substantial effort http://www.squeaksource.com/@Y4HhnL90iyA2TmAb/X0sPqshM; luckily  there was an older implementation.available to build upon.

Not sure whether nowadays there are other ways to read/write files old DBASE format files...

 

Cheers,

 

Hans Baveco

 

 

 

 

From: Serge Stinckwich <[hidden email]>
Sent: donderdag 4 juni 2020 5:32
To: Any question about pharo is welcome <[hidden email]>
Subject: [Pharo-users] GIS support for Pharo

 

Dear all,

 

there was already some discussion in the list about GIS support for Pharo previously.

 

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

 

I know of existing GIS software:

- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON

- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster

- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes

(to be moved to github)

- I found this project also: http://www.squeaksource.com/gekon.html

 

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

 

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?


Cheers,

--

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

hernanmd
In reply to this post by Stéphane Ducasse
Hi Stef


El jue., 4 jun. 2020 a las 11:21, Stéphane Ducasse (<[hidden email]>) escribió:
It would be good to have the related package under an umbrella. 
For example I can spend some time packaging hans package on github but only if it helps. 

I already migrated to Pharo and published in Github https://github.com/hernanmd/Shapes
so you may use that one if you like

Cheers,

Hernán
 
So let me know. 

S

On 4 Jun 2020, at 14:15, Serge Stinckwich <[hidden email]> wrote:

OpenGIS is an object-oriented meta-model for GIS. There is no implementation in Pharo but can give a good blueprint if we want to do something like that.

I’m GMT+8. So a meeting Thursday at 9am for you is great for me (2pm for me).
It would be nice if Hernan can join also, but might be difficult with the time zone difference.

Regards,

Sent from my iPad

On 4 Jun 2020, at 18:50, Norbert Hartl <[hidden email]> wrote:



Am 04.06.2020 um 12:31 schrieb Serge Stinckwich <[hidden email]>:



On Thu, Jun 4, 2020 at 4:11 PM Norbert Hartl <[hidden email]> wrote:
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:


Thank you Norbert for your interest on that topic.
I put Etienne Delay because he is not ont the pharo-users mailing-list and I'm working with him on GIS issues for CORMAS.

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages


You have done a lot of work. And we add all the work done by Hernan on supporting ESRI shapefiles, we have already a good start.

Etienne also mention the OpenGIS model in this issue: 

From what I understood, OpenGIS model crosscut many points of the Geography package:

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

We can try to do an online meeting to discuss about that with Etienne and other people interested by this topic.
We are mostly interested to have GIS support on CORMAS, so having a common repository will definitively help us.
At the moment we are using Roassal2 for CORMAS visualisatin and we are moving towards Roassal3.

Good idea! I just created the Geography package because I felt the need for it. But if there is something better I would like to use this instead. I'm generally available the best at wednesdays and thursdays. Next week is already stuffed but if you propose some DateAndTimes I'm sure we find a match. Which timezone are you in at the moment?

Norbert

Regards,
-- 


--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

SergeStinckwich
In reply to this post by Pharo Smalltalk Users mailing list
Hi Todd,

you can join. Everyone is welcome.
GDAL FFI integration would be great, but this is a lot of work I guess.

Regards,

On Fri, Jun 5, 2020 at 2:34 AM Todd Blanchard via Pharo-users <[hidden email]> wrote:
Hi Serge,

I would love to participate in getting some GIS features into Pharo.  I think it would be a fantastic platform for GIS.

My personal orientation is doing marine navigation (have boat with sensors, want boat to be be smarter about navigation).

My main interests is in being able to render S57/S52 formats.  There are a number of boat fans that balk at the price of expensive chart plotter computers and software.

They have given rise to some DIY stuff.  Some of it just rips code straight out of https://gdal.org - I think possibly a FFI integration with gdal might be an amazing resource.

I am time constrained for when I can work on this stuff but would like it a lot if we at least had some core data types for simple things like lat/lng, regions (polygons), and a decent general map renderer.

Anyhow, please include me in any conversations.  Navigation (both air and sea) are two things I have an interest in.

On Jun 3, 2020, at 8:31 PM, Serge Stinckwich <[hidden email]> wrote:

Dear all,

there was already some discussion in the list about GIS support for Pharo previously.

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

I know of existing GIS software:
- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON
- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster
- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes
(to be moved to github)
- I found this project also: http://www.squeaksource.com/gekon.html

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?

Cheers,
--



--
Serge Stinckwic
​h​
https://twitter.com/SergeStinckwich
Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

SergeStinckwich
In reply to this post by hernanmd
Yes Thursday 11/06 on CORMAS channel.
We can start at 10am in Germany, 4pm for me in Macau, 8am UTC.
Regards,

On Thu, Jun 4, 2020 at 8:22 PM Hernán Morales Durand <[hidden email]> wrote:


El jue., 4 jun. 2020 a las 9:16, Serge Stinckwich (<[hidden email]>) escribió:
OpenGIS is an object-oriented meta-model for GIS. There is no implementation in Pharo but can give a good blueprint if we want to do something like that.

I’m GMT+8. So a meeting Thursday at 9am for you is great for me (2pm for me).
It would be nice if Hernan can join also, but might be difficult with the time zone difference.


You mean next Thursday 11/06 ?
On discord cormas channel?
I could connect no problem.

Cheers,

Hernán

 
Regards,

Sent from my iPad

On 4 Jun 2020, at 18:50, Norbert Hartl <[hidden email]> wrote:



Am 04.06.2020 um 12:31 schrieb Serge Stinckwich <[hidden email]>:



On Thu, Jun 4, 2020 at 4:11 PM Norbert Hartl <[hidden email]> wrote:
I started this initiative for our company because we are in the mobility bubsiness where maps and geo centric things are important. It is not elaborate as a real GIS support but a start. So here my secret plan:


Thank you Norbert for your interest on that topic.
I put Etienne Delay because he is not ont the pharo-users mailing-list and I'm working with him on GIS issues for CORMAS.

- GeoJSON [1] was done because web services came up with that format to exchange geo shape information. Furthermore database like MongoDB changed their internal support for 2d/2dsphere indexes also to GeoJSON. There is a package GeoJSON-Voyage which is start of a helper to easily store Geo data in voyage-mongo.

- I started to do a KML Reader [2] because besides GeoJSON that is a widely used format. And this can be used in Google Earth which is the best free Geo editor that I know. 

- As KML and GeoJSON use a similar model for representing geo shapes and POIs I started to factor out that into the Geography package [3].

- At the moment in the Geography package there is only a 2D point class GGPoint to have something to hold geo coordinates (there is also a 3D variant). In the past I used Point as the class for these things but came to the conclusion that there is a distinction between a point and geo point when it comes to things like distance etc. So it is better to have them separate. Into this model I want to morph the classes for LineStrings, LinearRings, Polygons etc. from GeoJSON and KML to have a common foundation for the basic geo shapes lines, multi-lines, closed multi-lines (=polygons) etc.

- As GGPoint is distinct to Point this is just the context where you use it. The Geography package should be a companion to the Geometry package [4] which I forked from TelescopeSt to make it a community package which is good for this plan but also for roassal which uses the Geometry package. To me the geoX model should be switched between Geometry and Geography regarding to the context you want to work in being planar or spherical. 

- In my tools that I build this model classes have also gt-inspector extension so the shapes can be viewed just by inspecting them. I'm fighting with the roassal team to make it possible for geo coordinates which conflicts at the moment with their defined thresholds. But with the factoring the shapes into Geography I will move those extension to the Geography package as well

- I also implemented a polygon intersection algorithm (Weiler and Atherton) which I will then incorporate in any of the GeoX packages


You have done a lot of work. And we add all the work done by Hernan on supporting ESRI shapefiles, we have already a good start.

Etienne also mention the OpenGIS model in this issue: 

From what I understood, OpenGIS model crosscut many points of the Geography package:

So these are the pieces that are there. The plan in text is:

- Have a incarnation of a "point" and make that switch context from planar to spherical
- Use planar treatment with the Geometry package (intersections etc.)
- Use this "point" to generate shapes either geometric or geographic
- Be able to read and write in common formats like GeoJSON and KML
- Make shapes be composable and inspectable with the existing tools

I think GIS needs more but what we have is more than just a start. The projection system with the current code is WGS84 for sure. If there are other needs we need to think about this early. 

For everything else I'm open ears. Even for the idea of having a pharo-gis github project to collect those things to a common place. But I like to discuss GIS and not if it makes sense to have a all of these github repos.

We can try to do an online meeting to discuss about that with Etienne and other people interested by this topic.
We are mostly interested to have GIS support on CORMAS, so having a common repository will definitively help us.
At the moment we are using Roassal2 for CORMAS visualisatin and we are moving towards Roassal3.

Good idea! I just created the Geography package because I felt the need for it. But if there is something better I would like to use this instead. I'm generally available the best at wednesdays and thursdays. Next week is already stuffed but if you propose some DateAndTimes I'm sure we find a match. Which timezone are you in at the moment?

Norbert

Regards,
-- 



--
Serge Stinckwic
​h​
https://twitter.com/SergeStinckwich
Reply | Threaded
Open this post in threaded view
|

Re: GIS support for Pharo

Hans Baveco
In reply to this post by hernanmd

Thanks Hernan!

 

I will try to find out what the problem is with your shape file.

 

Btw is the code for reading/writing dbf files already available on github?

 

Hans

 

From: Hernán Morales Durand <[hidden email]>
Sent: vrijdag 5 juni 2020 0:25
To: Any question about pharo is welcome <[hidden email]>
Subject: Re: [Pharo-users] GIS support for Pharo

 

Hi Hans,

 

 

El jue., 4 jun. 2020 a las 6:07, Baveco, Hans (<[hidden email]>) escribió:

Would be an interesting project..

An old link to possibly still useful code:

 

http://wiki.squeak.org/squeak/3317

 

 

Btw the shapefile support, from the ESRI spec, was done by me and is still available on http://www.squeaksource.com/@CUT95k_uXmPU4uXY/HCmgtrop.

 

Thank you for the clarification (and actually sharing your work with ESRI files!)

I added proper credits in the Github forked repo : https://github.com/hernanmd/Shapes

 

I use it daily. I may have some fixes/additions, but in general the code as provided works well (I suppose the code at smalltalkhub is still mostly the same). Some shapefile formats are still missing, mostly because I never encountered them..

 

You mean some types are missing? Because I get this error when I try to read some SHP files: "Types > 20 are not yet accounted for"

 

I wrote this script to reproduce:

 

 | shpE legend urlRoot urlESRIFilePrefix urlESRIFileShp urlPath response fileRef |

" Download Shapefile resources "
urlRoot := 'https://github.com/nvkelso/natural-earth-vector/blob/master/110m_cultural/'.
urlESRIFilePrefix := 'ne_110m_populated_places'.
urlESRIFileShp := urlESRIFilePrefix , '.shp'.
urlPath := urlRoot , urlESRIFilePrefix.

#('.shx' '.dbf' '.shp') do: [ : ext |
| url |
url :=  (urlPath , ext , '?raw=true') asZnUrl.
(response := ZnEasy get: url) isSuccess
ifFalse: [ self error: 'Cannot download file' ].
fileRef := FileSystem disk workingDirectory / (urlESRIFilePrefix , ext).
fileRef writeStreamDo: [ : stream |
stream nextPutAll: ((ZnByteEncoder newForEncoding: 'koi8r') decodeBytes: response contents ) ] ].

 

Once downloaded:

 

| urlESRIFilePrefix urlESRIFileShp shpE |
urlESRIFilePrefix := 'ne_110m_populated_places'.
urlESRIFileShp := urlESRIFilePrefix , '.shp'.

" Load and display it in Morphic "
shpE := ShapeEnsemble fromFile: urlESRIFileShp.

 

Maybe it's related with the fact they are encoded as koi8r?

I checked with Zinc downloading first from the browser:

 

| shpFile |                                                                            
shpFile := 'ne_110m_admin_0_countries.shp' asFileReference.
[ shpFile binaryReadStreamDo: [ : in |
                (ZnCharacterEncoder detectEncoding: in upToEnd) identifier ] ]
        on: ZnCharacterEncodingError
        do: [ nil ].

 

 

Cheers,

 

Hernán

 

To read a complete shapefile one also needs to read dbf files. This was another substantial effort http://www.squeaksource.com/@Y4HhnL90iyA2TmAb/X0sPqshM; luckily  there was an older implementation.available to build upon.

Not sure whether nowadays there are other ways to read/write files old DBASE format files...

 

Cheers,

 

Hans Baveco

 

 

 

 

From: Serge Stinckwich <[hidden email]>
Sent: donderdag 4 juni 2020 5:32
To: Any question about pharo is welcome <[hidden email]>
Subject: [Pharo-users] GIS support for Pharo

 

Dear all,

 

there was already some discussion in the list about GIS support for Pharo previously.

 

Working on CORMAS multi-agent simulation platform: https://github.com/cormas/cormas some developers feel the need to have more GIS support for Pharo.

 

I know of existing GIS software:

- GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON

- ESRI ascii raster, done by Stephane recently: https://github.com/Ducasse/ESRI-ASCII-Raster

- shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes

(to be moved to github)

- I found this project also: http://www.squeaksource.com/gekon.html

 

I know that Etienne Delay is also interested by GIS support and propose to implement OpenGIS model support: https://github.com/cormas/cormas/issues/139

 

Can we try to unite and maybe create a pharo-GIS organization on github to federate our efforts?


Cheers,

--

12