points, lines, and polygons in Exhibit

29 views
Skip to first unread message

John Callahan

unread,
Mar 6, 2009, 4:47:51 PM3/6/09
to simile-...@googlegroups.com
A few quick questions regarding the "geo" part of exhibit:


1) Are adding points, lines, and polygons be possible in Exhibit?
Either in the stable or trunk versions? I see from
(http://people.csail.mit.edu/dfhuynh/projects/election08/election08.html)
that ex:polygon is possible. How about for lines?


2) Will these still be supported in the next version of Exhibit?


3) Can points, lines, and polygons be included on the same map, in the
same MapView? I have one feed with a "geocoords" field. This field
may contain coordinates for points, lines, or polygons. It might be
necessary to use another field to state which type of geometry that item
is, then pass that to ex:latlng ,ex:polygon, or ex:line????? I may
need to split that into different feeds for each geom type, not sure yet.


For the long run, I'd love to work on some other possibilities. For
example, textual coordinates are cumbersome when dealing with 6 places
past the decimal point for hundreds of records. It would be nice to
support links to KML files, GeoRSS Simple feeds, WMS services, maybe CSV
or text files with coordinates. These formats people can easily create
using Geo-types of software and can upload to a server. Some of these
return images to overlay, some return lists of coordinates. Thinking
about it now, maybe it's an external application's job to parse out KML
files or CSV/TXT files and pass coordinates into Exhibit. Something for
the future.


- John

--
**************************************************
John Callahan
Geospatial Application Developer
Delaware Geological Survey, University of Delaware
227 Academy St, Newark DE 19716-7501
Tel: (302) 831-3584
Email: john.c...@udel.edu
http://www.dgs.udel.edu
**************************************************

David Huynh

unread,
Mar 12, 2009, 3:29:34 PM3/12/09
to simile-...@googlegroups.com
John Callahan wrote:
> A few quick questions regarding the "geo" part of exhibit:
>
>
> 1) Are adding points, lines, and polygons be possible in Exhibit?
> Either in the stable or trunk versions? I see from
> (http://people.csail.mit.edu/dfhuynh/projects/election08/election08.html)
> that ex:polygon is possible. How about for lines?
>
John,

I didn't get much enthusiasm from posting that example, so I didn't see
any benefit from continuing that line of development. Is it something
you really want? If so, then please help me test it and make more
examples for it.

The polygon support is not in trunk/ or tags/ yet. But you can just copy
that example and see how it works.

> 2) Will these still be supported in the next version of Exhibit?
>

If there's enough interest and help...

> 3) Can points, lines, and polygons be included on the same map, in the same MapView?

Right now, no, but they should be.

> I have one feed with a "geocoords" field. This field may contain coordinates for points, lines, or polygons. It might be necessary to use another field to state which type of geometry that item is, then pass that to ex:latlng ,ex:polygon, or ex:line????? I may need to split that into different feeds for each geom type, not sure yet.
>

I'm thinking

<div ex:role="view" ex:viewClass="Map"
ex:latlng="..." // for points
ex:polygon="..."
ex:polyline="..."
></div>

> For the long run, I'd love to work on some other possibilities. For example, textual coordinates are cumbersome when dealing with 6 places past the decimal point for hundreds of records. It would be nice to support links to KML files, GeoRSS Simple feeds, WMS services, maybe CSV or text files with coordinates. These formats people can easily create
> using Geo-types of software and can upload to a server. Some of these return images to overlay, some return lists of coordinates. Thinking about it now, maybe it's an external application's job to parse out KML files or CSV/TXT files and pass coordinates into Exhibit. Something for the future.
>

That would be useful to a lot of other people. But because Exhibit can
be very useful to many different groups of people in different ways,
it's very hard for me to pursue any particular direction. So, if you
really want the geo aspect of Exhibit to grow more powerful, you'd have
to be the person spearheading that effort.

David

John Callahan

unread,
Mar 12, 2009, 5:22:27 PM3/12/09
to simile-...@googlegroups.com
David,

Yes, this is something I would definitely like.   Having the ability to display points, lines, and polygons I think is a wonderful feature I would use quite often.  And yes, I would be willing to come up with examples, test code, write some wiki pages, etc...  My background is in GIS so I am actually more familar with geospatial data and display than javascript coding... but I'm learning!

Maybe we could also add the ability to filter by geography (lat and long bounding boxes) such as maybe having a area of interest that by default covers the entire area. You could adjust the size of the box to filter. (Just thinking that sounds very similar to having a date range filter in Timeline.)

Adding the ability to display map markers as image icons would be nice as well  (although I think I've seen some custom apps that have already done this.)   I'll help wherever I can here with these.

- John

John Callahan

unread,
Mar 12, 2009, 5:58:41 PM3/12/09
to simile-...@googlegroups.com
Regarding the last point, I agree that it's difficult to see which direction to go.  There are so many ways to store geospatial, many of which are resource and storage hogs.  Imagine having 100 items, each with a URL-style field pointing to WMS services and Image and KML overlays to be displayed on the same map.  Performance would definitely be sacrificed.  Technically, this doesn't seem to be very hard as Google Maps supports these natively.  Even if you integrated OpenLayers (or similar FOSS Geo map clients), these types of overlays can be easily done.  Performance and variety of standards jump out at me as the biggest obstacles.


On a separate note, what about having a map extension that is similar to Timeplot?  For example, you can bring in one CSV file or spreadsheet that contains dozens or hundreds of data points w. location.  It could be a 2D array for different types of markers (like separate lines on Timeplot) or maybe separate maps (like different bands in Timeline.)  

- John

Marko

unread,
Mar 13, 2009, 6:56:16 AM3/13/09
to SIMILE Widgets
Now I wish I could help in software development :-( A way to add kml
files in a database would be wonderful!

David Huynh

unread,
Mar 15, 2009, 2:02:27 PM3/15/09
to simile-...@googlegroups.com
John Callahan wrote:
> David,
>
> Yes, this is something I would definitely like. Having the ability
> to display points, lines, and polygons I think is a wonderful feature
> I would use quite often. And yes, I would be willing to come up with
> examples, test code, write some wiki pages, etc... My background is
> in GIS so I am actually more familar with geospatial data and display
> than javascript coding... but I'm learning!
John,

Examples, test code, wiki pages--that'd be great!

By the way, Stefano and I are thinking of setting up a media wiki on
simile-widgets.org because we both don't like the Google Code wiki. It'd
also be easier to move old wiki materials from simile.mit.edu/wiki/
over. And anyone can sign up for an account on that new wiki without
having to be added as a code contributor on the Google Code project. Any
opinion on that?

> Maybe we could also add the ability to filter by geography (lat and
> long bounding boxes) such as maybe having a area of interest that by
> default covers the entire area. You could adjust the size of the box
> to filter. (Just thinking that sounds very similar to having a date
> range filter in Timeline.)

That feature is one that some of us have been wanting forever... It's a
bit tricky how to implement, though. What you probably want is to dim
out map markers outside the selected rectangle, but not to hide them
completely. There's also a conflict with how Exhibit has been
conceptually designed so far: there are facets (filters: list facet,
range facet, text search facet, etc.) and there are views (tile,
thumbnail, timeline, map, scatterplot, etc.). Facets do the filtering
while views do the presenting. The user interface might get conceptually
confusing if views also filter.

> Adding the ability to display map markers as image icons would be nice
> as well (although I think I've seen some custom apps that have
> already done this.) I'll help wherever I can here with these.

Is this different from the presidents example in which their photos are
rendered in their map markers?

David

David Huynh

unread,
Mar 15, 2009, 2:21:16 PM3/15/09
to simile-...@googlegroups.com
John Callahan wrote:
> Regarding the last point, I agree that it's difficult to see which
> direction to go.
Yes,... other people have used some of the tools for showing clinical
drug trial data, rocket test data, educational materials, historical
events, software development project deliverables, ...

> There are so many ways to store geospatial, many of which are resource
> and storage hogs. Imagine having 100 items, each with a URL-style
> field pointing to WMS services and Image and KML overlays to be
> displayed on the same map. Performance would definitely be
> sacrificed. Technically, this doesn't seem to be very hard as Google
> Maps supports these natively. Even if you integrated OpenLayers (or
> similar FOSS Geo map clients), these types of overlays can be easily
> done. Performance and variety of standards jump out at me as the
> biggest obstacles.
>
> On a separate note, what about having a map extension that is similar
> to Timeplot? For example, you can bring in one CSV file or
> spreadsheet that contains dozens or hundreds of data points w.
> location. It could be a 2D array for different types of markers (like
> separate lines on Timeplot) or maybe separate maps (like different
> bands in Timeline.)

That would be a good way to go. You will also probably want Babel to be
able to convert KML files from another domain into Exhibit JSONP. Note
that Timeplot can only load files (except for JSONP) from the same web
domain.

By the way, one of the type of geospatial data that I think will be very
useful is state and county boundaries, starting with those of the U.S.
For example,
http://elections.nytimes.com/2008/results/president/map.html
(switch to "County leaders") is quite an interesting visualization, and
the NY Times has produced a lot of U.S. maps broken down into counties.
If you click on a state on that map, it zooms in and you can then select
each county. I think that kind of map should become a reusable widget,
for anyone to plot any sort of per county data. Do you know where to
obtain the boundaries for the counties and states?

David

John Callahan

unread,
Mar 15, 2009, 4:14:56 PM3/15/09
to simile-...@googlegroups.com
Re: thoughts on spatial filtering, I like the way Exhibit has been
designed thus far, keeping filters separate form views. I was thinking
of the spatial filter as a bounding box issue, with north, south, east ,
west coordinates. It would simply be a numeric filter (maybe range
would work?) on each latitude and longitude. In other words, the
spatial filtering would be very to how it is now and separate from the
map view.

You could have a facet box with a google map dedicated to assigning the
spatial filter. If you don't want to require a Google Maps API key,
then simply have text boxes with north, south, east, west limits. Or
the site developer can create a list of places (predefined spatial
filters) and supply them on the site as a pull-down menu. There are
many ways to allow users to define bounding box coordinates. As long as
the spatial facet accepts only numeric coordinates, you can offer many
possibilities.

Another option (possibly?) is to allow users to draw a box inside the
Google Map view. It could show up on the map with a dotted red outline
and shaded interior. This would simply define coordinates to pass to
the spatial facet. Or, maybe you have a button that grabs the current
map view and sets those coordinates as the spatial filter. You probably
could also have a parameter that forces the spatial facet bounding box
to always match the google map view. Any case, the google map view
extents and spatial facet bound box would be separate.


- John



David Huynh wrote:

John Callahan

unread,
Mar 15, 2009, 4:45:53 PM3/15/09
to simile-...@googlegroups.com
That would be great. I'm not a big fan of the Google Code wiki either,
not compared to what else is out there.

It really depends on what you want from the site. You could go with a
standard wiki, like MediaWiki (http://www.mediawiki.org/wiki/MediaWiki)
or some others. They're relatively easy to setup and users are familar
with their functionality. However, from what I can tell of all the
things you might want to do in the near future, a Content Management
System seems to be the way to go.

Personally, I do a lot of my work in Drupal (http://drupal.org/). You
can set it up with wiki functionality, or with blogs/comments, forums,
RSS feeds, tagging, email notification, etc.., just about any way you
like. You can use it for project management (Exhibit, Timeline) with
issue tracking, releases, etc... If you don't mind installing the
server software (apache, php, mysql) and working in a module-based
system (there's a Drupal module that can do anything!), I believe it
offers the most flexibility, in both function and design, as compared to
the other major players in this arena (FOSS CMS) like Joomla, Wordpress,
and Plone.

We can talk offline if you want to know more about Drupal.

- John

John Callahan

unread,
Mar 15, 2009, 5:04:49 PM3/15/09
to simile-...@googlegroups.com
You can get U.S. state and county boundary data files from various
places. Here are a few. The most common GIS data format is called a
"ESRI shapefile" which has been around for about 15 years or so. There
are plenty of packages out there that can read/convert shapefiles. (For
command line, programmatic use, check out GDAL.OGR,
http://www.gdal.org/ogr/)


/The National Map/ Seamless Server
http://seamless.usgs.gov/index.php
(if you can figure out how to use it!)

The National Atlas
http://www-atlas.usgs.gov/atlasftp.html

U.S. Census Bureau TIGER files
http://www2.census.gov/cgi-bin/shapefiles/national-files

U.S. Census Bureau Generalized boundaries (smaller file sizes, less
accuracy)
http://www.census.gov/geo/www/cob/bdy_files.html

Geospatial One Stop (large repository of US GIS data and map services)
http://gos2.geodata.gov/


Note that there are tons of vertices with state or county level data.
There are about 3100+ counties. I've seen Google Maps struggle (polygon
overlays) with only hundreds of polygons at lesser resolution. So, KML
or straight coordinates wouldn't help much here. However, a flash widget
or served from a map server would be fine.

- John





David Huynh wrote:

Larry Kluger

unread,
Mar 15, 2009, 6:21:33 PM3/15/09
to simile-...@googlegroups.com

Hi David,

Yes, I think it'd be great to have a media-wiki on wiki.simile-widgets.org or some such.

Regards,

Larry




From: David Huynh <dfh...@alum.mit.edu>
To: simile-...@googlegroups.com
Sent: Sunday, March 15, 2009 2:02:27 PM
Subject: Re: points, lines, and polygons in Exhibit

David Huynh

unread,
Mar 16, 2009, 1:42:32 AM3/16/09
to simile-...@googlegroups.com
Thanks for the links! I tried to download some of the files containing
the state and county boundaries, but they are too huge (several dozens
of Mb). I need something substantially less fine-grained. Say, if each
county's boundary is rounded off to a 30-point polygon, with each vertex
taking 26 characters to encode (11 digits for latitude plus decimal dot,
same for longitude, a comma in between latitude and longitude, then a
semicolon before the next lat/lng pair), and there are 3100 counties,
then it'd take around 2.3Mb of plain text data. Do you know where I can
get such coarse-grained data? If I can get my hand on such data, then
I'll make a widget that anyone can use to plot any sort of U.S. county
or state level data. I think it'll be fun, with all that "open
government" / "open data" efforts going on.

David

David Huynh

unread,
Mar 18, 2009, 2:04:20 PM3/18/09
to simile-...@googlegroups.com
John Callahan wrote:
> Re: thoughts on spatial filtering, I like the way Exhibit has been
> designed thus far, keeping filters separate form views. I was thinking
> of the spatial filter as a bounding box issue, with north, south, east ,
> west coordinates. It would simply be a numeric filter (maybe range
> would work?) on each latitude and longitude. In other words, the
> spatial filtering would be very to how it is now and separate from the
> map view.
>
> You could have a facet box with a google map dedicated to assigning the
> spatial filter. If you don't want to require a Google Maps API key,
> then simply have text boxes with north, south, east, west limits. Or
> the site developer can create a list of places (predefined spatial
> filters) and supply them on the site as a pull-down menu. There are
> many ways to allow users to define bounding box coordinates. As long as
> the spatial facet accepts only numeric coordinates, you can offer many
> possibilities.
>
> Another option (possibly?) is to allow users to draw a box inside the
> Google Map view. It could show up on the map with a dotted red outline
> and shaded interior. This would simply define coordinates to pass to
> the spatial facet. Or, maybe you have a button that grabs the current
> map view and sets those coordinates as the spatial filter. You probably
> could also have a parameter that forces the spatial facet bounding box
> to always match the google map view. Any case, the google map view
> extents and spatial facet bound box would be separate.
>
In the last option, it seems like we should also plot the items on the
same map (so you see what you select). But then that map is a hybrid
between a facet and a view, which might be OK. I'll revamp the map view
when I get a chance.

David

John Callahan

unread,
Mar 18, 2009, 2:33:19 PM3/18/09
to simile-...@googlegroups.com
Yes, for that last option, the MapView would display both the spatial facet and the mapped items.  Areas on the map outside the spatial facet could be greyed out.  This could work.

I am tending to favor the idea of a separate spatial facet box in a sidebar.  This would be a google map where the current view extent would be the spatial filer.  Instead of a google map, this could also be text boxes with north, south, east, west bounding coordinates.

This would reduce confusion in the MapView.  It's also desirable in many cases to use a spatial filter without seeing them on a map.  (e.g., show me all events that happened in a certain place/city/state/country, or show me all publications written about a certain geographic region.  No map view required here, just a spatial filter.)

- John

**************************************************
John Callahan
Geospatial Application Developer
Delaware Geological Survey, University of Delaware
227 Academy St, Newark DE 19716-7501
Tel: (302) 831-3584  
Email: john.c...@udel.edu
http://www.dgs.udel.edu
**************************************************


Reply all
Reply to author
Forward
0 new messages