Can I have 45 degree view in osmdoird maps in android? - osmdroid

I wonder if there any perspective view in osmdroid? I mean 45 degree view so I be able to view map almost horizontally?
Thanks ...

There is nothing similar to the Google Maps Camera "tilt viewing angle" in osmdroid.
That would be a nice feature...

I find some interesting project of University of Bremen few days ago. I think it's can help you.
It's vector tiles map which use osmdroid as library and can change degree of view, you can get more info or example by this link - https://github.com/opensciencemap/vtm
I don't use it now, but want to use this in future.
WebGL Demo for example
http://opensciencemap.org/s3db/#scale=17&rot=40&tilt=65&lat=56.826&lon=60.615

Related

How do you make a CCSprite appear as slanting like the star wars intro?

Skewing x and y coordinates doesn't give that kind of effect. Any ideas on how to achieve this kind of effect? I already use cccamera but there are no examples on how to properly implement this. This image btw is from cocos2dx tried the c++ code still didn't work
I feel I need to share this once and for all. So this is how camera works when you want a slanting ,45degree or pseudo3d view of your background :
First set your director to 3d perspective
[director_ setProjection:kCCDirectorProjection3D];
If you only want some of the sprites to appear this way then remember this
all nodes have camera (cocos2d v.3 doesn't seem to have it anymore I don't know why)
so you do this:
[mysprite.camera setEyeX:0 eyeY:-40 eyeZ:10];
[mysprite.camera setUpX:0 upY:0 upZ:1];
Play with the values that fits your need. Hope it will help others!

how to query the database to return all zip codes with a given distance (ie 5 miles) from a given zip code using geopy

Hi frens I am using geopy to calculate the latitude and longitude. Now I want to get the list of areas given distance from a zipcode.How to get that?
Well, as I can see, geopy doesn't have any built-in capability to get a list of areas around some coordinates.
But you can use a workaround. Take your geocode and calculate coordinates (latitue and longitude). Then imagine a grid on the map with a cell size equal to area of the smallest one you need to find around your location.
Use geopy to get an area name belonging to the each cell corner of your grid. Is that ok for you? It will get you some kind of approximation because a grid is not a circle and you may miss some small areas. But I think in most cases the solution will work fine.
It is much easier to locate zipcodes inside a rectangle than in a circle so I would recommend that you approximate your problem by looking for zipcodes inside a given rectangle.
Here are answers to the question of how to get list of zipcodes in given polygone: Find zipcodes inside polygon shape using google maps api
Summary
You need geometry for each zipcode. Once you have that you need to be able to query it using database that supports geoquery. One such database is Google's Fusion Table and there is already a geometry data table for zipcodes available here: https://www.google.com/fusiontables/DataSource?docid=1AxB511DayCdtmyBuYOIPHIe_WM9iG87Q3jKh6EQ#rows:id=1
Here's the sample query for Fusion Table data.
Another approach is server side code using PHP and CSV data. Here's live demo: http://daim.snm.ku.dk/demo/zip/. The page also has download for code.
If you use any of above technique please make sure to upvote answers of original authors :).

Perspective Projection and Z-buffering of a 3D head to form a face image

Input: 53490 3D points and for each point (xyz) and color (rgb) of a head
Output: 2D face image as viewed from a particular position / direction
Platform: Matlab C/C++
After study, I found the steps to be implemented
Perspective Projection http://en.wikipedia.org/wiki/3D_projection
Z-buffering http://en.wikipedia.org/wiki/Z-buffering
Phong reflection model http://en.wikipedia.org/wiki/Phong_reflection_model
I implemented the above 3 steps in Matlab. But it takes 8 min for the execution. The 2D rendering is part of my project; I will be calling the 2D rendering part 5000 times later. I want the execution time under 1sec.
The bulk (99.9%) of time is taking for z-buffering. The implementation is done following the wiki link.
Can anyone help me to reduce the time in Matlab or suggest other platform?
Any tutorials/demo references to understand the above steps will be helpful.
Thanks in advance
I don't recommend you doing this in matlab, because you may need to visualize a big volume.
Try vtk, and you may need some programming.
Here is a simple one (3D project) from ImageJ: http://imagejdocu.tudor.lu/doku.php?id=gui:image:stacks

How to determine sunset/sunrise including terrain shadows.

In Google Earth you can use the "Sunlight" layer to view shadows cast by the terrain at any given DateTime: http://i.stack.imgur.com/YFGMj.png
However, I have not been able to find any way to access the sunlight/luminosity/shadow/etc values from the API.
I'm looking for a way to supply Lat, Long and DateTime to determine if an area is in sunlight (taking terrain shadows in to account, there are countless services that will provide simple Sunrise and Sunset times, but these do not consider terrain). This can be done manually with Google Earth, but I'm looking for a programatic method.
Thanks for any thoughts, ideas, leads...
I realise that this is an old question, but it surfaced in a google search I just did, and I liked the focus.
Since you're looking for a programmatic way of determining if a point on earth given by a longitude and latitude tuple is exposed to sun at a given time, I can't help you right now. However, I'm in a position to be able to set up such an API quite easily if we see that this is a feature that many people need. At suncurves.com we calculate sunrise and sunset times accounting for terrain. The solution we've set up so far is a web interface where a user can search for an address or drag and drop the icon on a map to get sunrise and sunset times through the year for that exact spot accounting for terrain. We want to create an API to our data, but we do not have a clear specification of the scope of this API yet. What you ask for requires that we need to:
Calculate the apparent horizon from the viewing point of the
longitude and latitude. This means scanning the terrain data in a
search radius of 30-50 km around your point.
Calculate the sun's position at the specified time.
Calculate the sun's position at the specified time. Determine if the
sun is under or over the horizon as given by the terrain surrounding
your point accounting for atmospheric refraction.
Here's an example from Chamonix, France where the common flat terrain versions of sunrise, sunset times are pretty worthless.
http://suncurves.com/v/7/
I am not sure about determining whether an AOI in in the sun or shade at a certain time, however you can set the SUN to be on or off in the API by using
GESun.setVisibility
Edit:
Using the GE-plugin, create a LookAt with your desired AOI lat/long where the view is directly above looking straight down. Depending on the size of you actual AOI I would keep the view as low to the ground as possible.
Then capture a screenshot/image - I do not think this is possible through GE (if anyone knows a way I would like to find out), so maybe use javascript to take it - I found this Q on SO that provides some insight.
Take a screenshot with GESun.setVisibility set ON and then another with it OFF
Compare the two images for darkness/lightness or something and determine if your AOI is in the shade or not. You might find it better to surround your AOI in a Polygon of some sort in order to help your program distinguish it from the rest of the image - depending on the height the LookAt was taken from etc etc....
I do not have any ideas on how to compare the images, but yet again another search on SO resulted in this (I would presume finding the values of COLOR_BLACK in PHP ImageMagick) and this (Color Buckets idea).
Depending on your method of choice, it might help to alter your images to black/white before doing the comparing.

How to achieve falling effect in cocos2d without physics

I want to show an effect of falling blocks which settle down at pre-determined position after some falling animation.
Can this be done without using physics engine?
I found a better and easier way to do this in cocos2d by using CCJumpTo action
CCActionInterval *jump1 = [CCJumpTo actionWithDuration:3 position:sp.position height:150 jumps:2];
sp.position = ccp(10,100);
[sp runAction:jump1];
Where sp is the CCSprite for the block.
All you need is to simulate gravity, the acceleration of the object. This could be achieved quite easily with a custom animation curve. Please have a look at this QA "how-to-create-custom-easing-function-with-core-animation", which shows a way to create the curve you need. Here is some more about "Animation Types Timing" by Apple.
The function you are looking for is called
functionWithControlPoints, which has four input parameteres, so yes you can put in any random element you wish with a custom curve.
"Easing" is your answer. You can choose the method that you need visually from the links below.
Tim Groleau's easing generator
jQuery Easing Demos