How to convert a shapefile in map projection coordinates to geographic coordinates? - shapefile

I am trying to use basemap to plot NYC with a shapefile. However, the shapefiles provided by NYC (https://www1.nyc.gov/site/planning/data-maps/open-data/districts-download-metadata.page) are don't use the proper coordinates to be read by the shapefile.
My IDE gives me this message:ValueError: shapefile must have lat/lon vertices - it looks like this one has vertices
in map projection coordinates. You can convert the shapefile to geographic
coordinates using the shpproj utility from the shapelib tools
(http://shapelib.maptools.org/shapelib-tools.html)
I looked it up but have no idea how to use it. Could someone help explain how to use that utility or have an easier way to accomplish what I am trying to do?
Thanks in advance

Related

create 3D surface (CGAL::make_surface_mesh) by set(10 million ) of points 3D

I have 10 million points as input data and I want to create 3D surface(3D-Delaunay triangulation) by them.
I understand that I should use CGAL library.
In example here as input data is sphere and it is defined by formula.
I want to create surface by points, not by formula.
Please help me with this issue.
The link you give cannot take points as input. Please have a look at several algorithms for surface reconstruction for point sets.

Gaze tracking with a webcam (openCV and C++)

I'm trying to realize a tool that returns the 2D coordinates of the point that the user is looking at. To do that I'm using openCV, c++ language and a low-cost webcam. I have the 2D coordinates of the center of the two pupils (leftPupil, rightPupil) but I don't know how to find the user's gaze.
I suppose that some information is missing but I don't know the right formula to estimate the gaze.
Is it mandatory to add a laser to get the distance of the user from the webcam? Must I analyze the geometric form of the pupil (if they are circles or elipses)? In this case, how can I detect the case in which they are eliptic or round?
Thank your for your ideas

OpenCv Blob tracking of point relative to plane

Am doing an installation that tracks blobs using openCv, and projecting graphics over the blobs. Problem is my camera is off and away from the projector.
I'm thinking to get the point's position in relation to the projection's plane, I would need to calibrate by marking out the plane's corners as seen in the camera view.
My problem is how do i use that 4 points info, and then convert the tracked blob from the camera view to the projection plane, so the projected graphic lines up with the tracked blob? Not sure what i should be searching for.
After you detect the 4 corners points, you can calculate the transformation to the projector plane by using PerspectiveTransform.
Once you have this transformation, you could use warpPerspective, to go from one coordinate system to another.
Unfortunately I'm unable to help with a minimal code example at the moment, but I recommend having a look at ofxCv and it's examples. There is a camera based undistort example, but the wrapper also provides utilities for warping/unwarping perspective via warpPerspective and unwarpPerspective.
Bare in mind ofxCv has handy function to convert to/from ofImage to cv::Mat like toCv() and toOf()
ofxCv may make it easier to use the OpenCV functions Elad Joseph recommends (which sound like exactly what you need)

matplotlib plots in Cylindrical and Spherical coordinate systems

For example, if I wanted to create polar coordinates plot I could use this code:
self.axes = self.figure.add_subplot(111, projection='polar')
But I did not find any 'Cylindrical' or 'Spherical' projections.
Does anyone know how to create these plots?
May be it's useful for your task:http://matplotlib.org/basemap/users/cyl.html

formula to convert Lat and Long to x & Y in an Image

HI
I have a Map Image that I got from OpenstreetMap(Osmarender Image ) .My question is
how to convert geographic coordinates to the co-ordinates of my picture (that is in pixels on X and Y on a picture). That is I receive geographic coordinates and it is necessary for me to draw this point on my picture.
Is there any API availabel in QT for processing this type of Map Problem
Check out the Proj4 library. You need to map the lat-longs to an XY coordinate system (e.g. UTM) and then map this to pixel space. Don't think Qt has anything like this.
Check the code for my mapsnap example, in particular MapModel::draw() function. If you know the zoom level of the OpenStreetMap rendered image and the tile offset, it is a matter of implementing the slippy map tile approach.
The Answer I was expecting can be found at
Convert Lat/Longs to X/Y Co-ordinates
Thanks