Lawrence Bottorff wrote on 01/14/2017 09:48 AM:
I was wondering if Racket could be used to create a new sort of GIS app, i.e., geographic 
information system. It would have to do "vector graphics," which is to say every 
primitive drawing object is real, i.e., isn't just a setup step toward creating a raster bit map -- 
to be thrown away afterwards. For example, if you use a square object to represent a building, then 
that object should persist as something real, to which various attributes can then be attached, 
furthermore, to be part of a graph database. On the UI side, the objects should be 
"clickable," i.e., an actual object should be addressed. The bitmap idea of clicking on a 
spot -- connecting spot with coordinates, then with other data -- won't do.

Yes, one can implement a cross-platform GIS program in Racket. If you want build an actual GIS or GIS-like program, rather than only using that as an example, some comments...

At first glance, how I suspect you would probably want to do it is to represent the GIS objects in Racket structs/objects, use a Racket canvas, and use the Racket vector drawing primitives to draw into the canvas while traversing the pertinent Racket GIS structs/objects (you can let the canvas and DC do the clipping and scaling).

If your GIS data set in Racket structs/objects is very large, and your application adds significant data to the objects being displayed for some reason, then you might want to also introduce a partial homomorphic set of Racket structs/objects just for the ones being displayed. You could also use this display set to implement rapid UI selection of what objects/attributes to include in the view.

Then, to implement interaction, like clicking to select a building, you translate the screen or canvas coordinates you get from mouse events, back to your GIS coordinates, and you do a "picking" lookup in your Racket objects (either your all-in-one Racket structs/objects, or in your display Racket structs/objects). The picking can be a linear search, or you can use fancy structures (like a range search tree) if linear is practically slow for your data sets and hardware.

You might consider using a library that gives actives graphic objects (like in the Self morph worlds, for an early example), but be cautious: you potentially have a very large number of objects in a view at a time, and many of those libraries are designed for small numbers of active objects. Also, it's not that hard to do it yourself, and then you can optimize it for your needs, reduce surprises late in development, and also be able to debug and maintain it.

If this were for a commercial project, there are Racket consultants who can build this kind of technical program for a company (or help in-house developers to do it), and handle other challenges that come up. Or, regardless of whether this is for an industry, academic, non-profit, or hobby project, people (including some of those fancy-pants consultants) will answer what questions they can on the email list.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to