Get points of area border by postal code - geocoding

i would like to show area borders on google map by given postal and country code. I can draw polygon by given set of coordinates. I am trying to get needed coordinates from OSM overpass, but I have to do something wrong, because it doesnt work.
Im trying this query:
rel["postal_code"="11000"]["country_codes"="cz"]
but response is empty.
Can anyone help me how can I get areas border coordinates from OSM overpass or another way?

Related

Chart.js Draw grid lines inside or over the polar points

Looking for a solution to get the grid lines inside or over the polar area points.
Like the image attached.
I found the code which draws the gridLines and the one draws the point.
I also see it's possible to pass a creationPattern() as background.
But I don't know how to get them working together.
Maybe a solution can be simply show the gridLines over the points and not behind.

Matplotlib axis text coordinates inconsistency?

I'm working on a piece of code to automatically align x-axis labels for a variable number of subplots. When I started having trouble setting label positions manually, I checked to be sure I could just transform from one set of coordinates to the other without changing anything, with a code snippet like this:
# xaxes is a list of Axes objects
textCoords = [ax.xaxis.get_label().get_position() for ax in xaxes]
newCoords = [ax.transAxes.inverted().transform(ax.xaxis.get_label().\
get_transform().transform(c)) for ax,c in zip(xaxes,textCoords)]
for ax,c in zip(xaxes,newCoords): ax.xaxis.set_label_coords(*c)
In theory, this code doesn't change any coordinates; it just gets the coordinates of each label, maps it to Axes coordinates using the Text object's internally-stored transform, and then sets the position. Yet running this code removes my labels entirely, and a little experimentation shows that they go off the bottom edge of the plot.
Have I just misunderstood the transforms involved here?
You're understanding the transforms correctly, but there's a caveat to using display coordinates before the plot has been displayed.
The short answer is that putting in a call to plt.draw() before your code snippet above will fix your immediate problem.
You're trying to link the different axes display system through display coordinates. However, before the plot has been drawn the first time, the renderer isn't fully initialized yet, and the display coordinates don't have much meaning.
Can you elaborate a bit more on what you're trying to do? There may be an easier way.
Alternatively, if you want to avoid the extra draw, you can link things through figure coordinates before the plot has been drawn. (They're well defined regardless.)

Segment A Picture In Opencv

i using c++ with opencv, i can't do segment pictures like this:
(sorry for my english)
PICTURE 1
PICTURE 2
i want segment the sheet, removing the background located at the edges.
i trying use "watershed" to locate the position of the sheet, but had a problem with the image format, i don't know if there another algorithm that work me.
the idea is crop the white sheet, removing the background, unknow the size and position of the sheet. but always in the center of the image looks the sheet, someone can help me?
Thanks!!
You can do some thing like,
Threshold the image, here assume the image with white sheet.
Now find contour and select largest contour.
Now get the bounding box for the largest contour and crop the sheet.

Finding individual center points of circles in an image

I am using open CV and C++. I have a completely dark image which has 3 colored points on it. I need their center coordinates. If I have only one colored point in the dark image, it will automatically display its center coordinate. However,if I take as input the dark image with the 3 colored points,my program will make an average if those 3 coordinates and return the center of the 3 colored points together,which is my exact problem. I need their individual center coordinates.
Can anyone suggest a method to do that please. Thanks
Here is the code http://pastebin.com/RM7chqBE
Found a solution!
load original image to grayscale
convert original image to gray
set range of intensity value depending on color that needs to be detected
vector of contours and hierarchy
findContours
vector of moments and point
iterate through each contour to find coordinates
One of the ways to do this easily is to use the findContours and drawContours function.
In the documentation you have a bit of code that explains how to retrieve the connected components of an image. Which is what you are actually trying to do.
For example you could draw every connected component you will find (that means every dot) on it's own image and use the code you already have on every image.
This may not be the most efficient way to do this however but it's really simple.
Here is how I would do it
http://pastebin.com/y1Ae3e2V
I'm not sure this works however as I don't have time to test it but you can try it.

Box2D - How to make a hollow circle

I would like to know how to make a hollow circle, with boxes and distance joint, something like this:
(source: subirimagenes.com)
I've tried it but I cant get a perfect circle, any idea? thanks
Here is one route.
Draw a regular n-gon. Below, the blue is a regular 16-gon.
Then translate each edge outward radially, and connect each
translated (red) edge to its original (blue):