The maps are static and we rewrote all of your px2ll and ll2px functions in PHP.
Hi Chad,
Sorry for hijacking this thread, but I wanted to show you what I've been using gheat for. I generate maps like this one: http://trends.numberinvestigator.com/current-victims/archives/highres/2009-10-19-07-01-04.png
every hour. We track telemarketing calls received, and robocalls made and build maps and videos. The maps are static and we rewrote all of your px2ll and ll2px functions in PHP.
POn Tue, Nov 17, 2009 at 2:51 PM, Chad Whitacre <ch...@zetaweb.com> wrote:Hrm. Ok, glad you found a workaround. Sounds like ll2px needs some scrutiny though.chadOn Mon, Nov 16, 2009 at 7:59 PM, Steven Lehrburger <lehrb...@gmail.com> wrote:
I took your (implicit/unintended?) suggestion and started playing
around with using px2ll instead of ll2px, and that seems to have done
the trick. The following three lines seem to be giving me what I need:
self.georange = gmerc.px2ll(x * 256, y * 256, zoom)
self.georange_next = gmerc.px2ll((x + 1) * 256, (y + 1) * 256,
zoom)
self.zoom_step = [ self.georange_next[0] - self.georange[0],
self.georange_next[1] - self.georange[1]]
I might run into problems at the edges of the map, but it looks like
it's working for now. The problem was that Google doesn't seem to use
latitudes that range all the way from 90 to -90, since px2ll(0,0,0)
returns (85.051128779806604, -180.0), so that was probably breaking my
previous calculations.
Thanks, and I'll be sure to let you know when this is done :)
- Steven
On Nov 16, 5:28 pm, Steven Lehrburger <lehrbur...@gmail.com> wrote:
> (So maybe I've made a mistake somewhere, but if not, then I think
> ll2px is not returning the actual height of the map in pixels.)
>
> On Nov 16, 5:26 pm, Steven Lehrburger <lehrbur...@gmail.com> wrote:
>
> > Hi Chad, thanks for getting back to me so quickly!
>
> > First, I apologize, I misspoke in my first email and switched lat and
> > long - I meant "I'm getting a reasonable longitude for that tile from
> > ll2px, but I'm getting a latitude of ~37". Also, you're right, I
> > wasn't sufficiently specific about what I was doing - once I have the
> > width and height of the entire map at that zoom level in pixels (which
> > is all I'm using ll2px for), I'm dividing each by 256 to get the
> > number of rows and columns of tiles. I'm then using that to get the
> > number of degrees of latitude and longitude per tile, and the latitude
> > and longitude of the northern and western edges of the tile in which
> > I'm interested.
>
> > I have a python script that reproduces the problem athttp://dpaste.com/121311/,
> > which borrows heavily from but is not identical to code in gheatae/
> > tile.py on the gheat-ae project. Run "python gmerc_test.py 2412 3079
> > 13" from the command line and you should see output like:
> > x, y and zoom = 2412, 3079 and 13
> > width, height = 2097152, 2701322
> > numcols, numrows = 8192, 10553
> > zoom_step = [0.017056761110584667, 0.0439453125]
> > georange = (37.482232540509813, -74.00390625)
> > It's the latitude (the first part) in georange that I'm expecting to
> > be ~40 instead of ~37. It *is* possible I'm calculating the georange
> > incorrectly, but I've thought it through over and over and I think
> > that's correct: if the 0,0 tile has a latitude of 90, I want to go
> > down/south from there by an amount for each tile equal to the number
> > of degrees per tile.
>
> > Thanks again,
> > Steven
>
> > On Nov 16, 4:13 pm, Chad Whitacre <c...@zetaweb.com> wrote:
>
> > > Steven,
>
> > > Sorry for the troubles. However, I'm confused about what "a reasonable
> > > latitude for that tile from ll2px" means, since ll2px returns pixel
> > > coordinates, not lat/lng. Do you mean px2ll here?
>
> > > Could you provide some example python code that reproduces the problem?
>
> > > Thanks!
>
> > > chad
>
> > > On Mon, Nov 16, 2009 at 2:11 PM, Steven Lehrburger <lehrbur...@gmail.com>wrote:
>
> > > > Hi everyone,
>
> > > > I'm a graduate student at NYU's Interactive Telecommunications Program, and
> > > > I'm working on a visualization of a Foursquare <http://foursquare.com/> (NYT
> > > > article)<http://www.nytimes.com/2009/10/19/technology/internet/19foursquare.html> user's checkin
> > > > data for my class <http://webremix.org/> on website mashups. I'm trying to
> > > > use what appears to be a relatively new port of gheat<http://code.google.com/p/gheat-ae/>for Google AppEngine, and I think I'm having trouble with thell2px(lat,
> > > > lng, zoom) function in gmerc.py. The function is the same in both
> > > > projects, and it looks like it's being called in both projects with
> > > > lat=-90, lng=180, and the current zoom level to get the width and height
> > > > of the entire map at that zoom level in pixels. That information is then
> > > > used by gheat-ae to determine the latitude and longitude bounds of the
> > > > current tile for querying the database of points to select only those items
> > > > that will be displayed on that tile of the map, and it's also used for
> > > > determining the pixel locations of each point for calculating their colors.
>
> > > > It appears, however, that the function isn't quite working. At zoom level
> > > > 13 the tile at x=2412 and y=3079 has a latitude of approximately 40.7 and a
> > > > longitude of approximately -74.0 (Google has a nice little Tile Detector<http://code.google.com/apis/maps/documentation/examples/tile-detector...>example, that location is in lower Manhattan near NYU). I'm getting a
> > > > reasonable latitude for that tile from ll2px, but I'm getting a longitude
> > > > of ~37, which is too far south (near Washington D.C.). Since ll2pxcalculates the latitude and the longitude differently it seems possible that
> > > > one would be off but not the other; could those constants at the top of
> > > > gmerc.py somehow have changed?
>
> > > > Really, ll2px is more general than I need - this width and height that it
> > > > returns is only used by gheat-ae to get the number of rows and columns of
> > > > tiles in the entire map at the current zoom level; there must be a simpler
> > > > way to do this that does not require a modified version of Google's
> > > > obfuscated JS?
>
> > > > Thoughts, anyone? If it's working for everyone else, then my problem might
> > > > be somewhere else; but my other stuff seems to be working ok...
>
> > > > Thanks!
>
> > > > Best,
> > > > Steven Lehrburger
> > > > NYU ITP c/o 2010
> > > >http://lehrblogger.com
>
> > > > --
> > > > You received this message because you are subscribed to the Google Groups
> > > > "gheat" group.
> > > > To post to this group, send email to gh...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > gheat+un...@googlegroups.com <gheat%2Bunsu...@googlegroups.com>.
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/gheat?hl=.
--
You received this message because you are subscribed to the Google Groups "gheat" group.
To post to this group, send email to gh...@googlegroups.com.
To unsubscribe from this group, send email to gheat+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gheat?hl=.
--
You received this message because you are subscribed to the Google Groups "gheat" group.
To post to this group, send email to gh...@googlegroups.com.
To unsubscribe from this group, send email to gheat+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gheat?hl=.
--
You received this message because you are subscribed to the Google Groups "gheat" group.
To post to this group, send email to gh...@googlegroups.com.
To unsubscribe from this group, send email to gheat+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gheat?hl=.
It sounds like your solution would work without Aspen, is that
correct? I don't think my ISP will allow me to run Aspen on their
servers and a php solution without any custom daemons would be great.
Chad, gheat looks perfect for a community project I am working on to
map different types of crime in my town.
--
You received this message because you are subscribed to the Google Groups "gheat" group.
To post to this group, send email to gh...@googlegroups.com.
To unsubscribe from this group, send email to gheat+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gheat?hl=en.
I believe JJ Guy's standalone port generates KLM files.
Chad, Great work!! I was able to get gheat working in a lot less time
than I thought.
--
You received this message because you are subscribed to the Google Groups "gheat" group.
To post to this group, send email to gh...@googlegroups.com.
To unsubscribe from this group, send email to gheat+un...@googlegroups.com.
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/gheat?hl=.
--
You received this message because you are subscribed to the Google Groups "gheat" group.
To post to this group, send email to gh...@googlegroups.com.
To unsubscribe from this group, send email to gheat+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gheat?hl=.
--
You received this message because you are subscribed to the Google Groups "gheat" group.
To post to this group, send email to gh...@googlegroups.com.
To unsubscribe from this group, send email to gheat+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gheat?hl=.
Does anyone have a download link?
To view this discussion on the web visit https://groups.google.com/d/msg/gheat/-/bsjKkuBB7C8J.
To post to this group, send email to gh...@googlegroups.com.
To unsubscribe from this group, send email to
gheat+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gheat?hl=en.
For more options, visit this group at http://groups.google.com/group/gheat?hl=en.
Sorry, I meant a PHP port download, but Im guessing since it isn’t listed it hasn’t been created, sorry about that lol I thought I read in the post history that someone created one. I may do it and Ill be sure to post the source. Thanks J