Re: [racket-users] Re: Racket graphics?

2017-01-14 Thread Alex Harsanyi
On Saturday, January 14, 2017 at 10:48:26 PM UTC+8, Lawrence Bottorff wrote:
> This is all very impressive, indeed. 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.
> 

I am not really familiar with full requirements for a GIS application, and I
never consiered ActivityLog2 a GIS application, however, you might find the
following parts of it useful:

* a map widget, which can display Open Streed Map based maps.  It is written
  entirely in Racket, and while it does fetch tiles from the network, it does
  all drawning and user interaction itself (that is, it does not embedd a web
  browser in a window)

* the map widget allows panning and zooming, as expected, but does not
  implement picking, as I didn't need that feature.
 
* the map widget can display data tracks, and simplifies these tracks as
  needed for display purposes.  My use cases involve tracks of about 3000 to
  1 points, with the biggest track I tested having about 13
  points. Drawing is fast and smooth.

* there are some map utilities that might be usefull (e.g. calculating map
  distance and bearing from lat/lon points), see "map-util.rkt"

* there's an elevation correction algorithm which works entirely offline and
  produces pretty good results, at least as good as online services.

* data is stored in a SQLite database, my database contains 1844982 track
  points and 1819 activities and more would be imported after my run today :-)
  So far, the system has scaled surprisingly well, at least I was pleasantly
  surprised at how fast it is.

If you want to test it out, you can import some FIT files from the
"test/test-data" folder, some of these have GPS tracks, so you will have a map
displayed and you can play around with it.

Best Regards,
Alex.

-- 
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.


Re: [racket-users] Re: Racket graphics?

2017-01-14 Thread Daniel Prager
> Also, are these links listed in your responses done in Scribble?

Yes: it's standard for Racket documentation.

What would be the novel aspect(s) of your GIS app?

Dan

-- 
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.


Re: [racket-users] Re: Racket graphics?

2017-01-14 Thread Neil Van Dyke

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.


Re: [racket-users] Re: Racket graphics?

2017-01-14 Thread Lawrence Bottorff
This is all very impressive, indeed. 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.

Also, are these links listed in your responses done in Scribble?

-- 
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.


Re: [racket-users] Re: Racket graphics?

2017-01-14 Thread Daniel Prager
Lawrence writes
> Could it do diagrams as well as TikZ  ...

For making-TIkz like diagrams check out Jens Axel Søgaard's MetaPict
library. It has as an explicit goal "to narrow the gap between Scribble and
LaTeX + MetaPost/Tikz".

https://soegaard.github.io/docs/metapict/metapict.html


Personally, I get a lot of mileage out of 2htdp/image:



https://docs.racket-lang.org/teachpack/2htdpimage.html



Dan

-- 
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.


[racket-users] Re: Racket graphics?

2017-01-14 Thread Alex Harsanyi
On Saturday, January 14, 2017 at 12:15:50 PM UTC+8, Lawrence Bottorff wrote:
> I've seen Racket graphics doing some basic graphics. How expressive is it? 
> Could it do diagrams as well as TikZ or gnuplot? What output formats are 
> there? Could it be like Processing and do 3-d and motion?

I think racket graphics is pretty good and the plot package is fantastic, see 
https://docs.racket-lang.org/plot/intro.html

Also, http://alex-hhh.github.io/ActivityLog2/ contains some screenshots of the 
practical plots that can be made using it.  You can export plots as images 
(including SVG), which is pretty cool.

Cheers,
Alex.

-- 
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.