coordinates

How to get the X Y coordinates and pixel size of a TextView?

别等时光非礼了梦想. 提交于 2019-12-04 05:39:19
Given a TextView , is it possible to know at runtime the X and Y coordinates of where it is drawn? Is it also possible to know the size (width/length) in pixels? There are getLeft() , getTop() , getWidth() , getHeight() methods for a view, it works for textView too. for more information , see the following link... getLeft() and getTop() will return you the starting x,y co-ordinates. http://developer.android.com/reference/android/view/View.html Coordinates relative to parent int x = textView.getLeft(); int y = textView.getTop(); Absolute coordinates int[] location = new int[2]; textView

How to change the coordinates of a text in a pdf page from lower left to upper left

谁都会走 提交于 2019-12-04 05:31:50
问题 I am using PDFBOX and itextsharp dll and processing a pdf. so that I get the text coordinates of the text within a rectangle. the rectangle coordinates are extracted using the itextsharp.dll. Basically I get the rectangle coordinates from itextsharp.dll, where itextsharp uses the coordinates system as lower left. And I get the pdf page text from PDFBOX, where PDFBOX uses the coordinates system as top upper left. I need help in converting the Coordinates from lower left to upper left Updating

Filter coordinates in a given range

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 05:29:39
问题 I've got hundreds of .out files with geographical positions, that I will bulk import into an SQLite database. However, to save time, I will only import the line with geographical coordinates inside some intervals. The file is like this: value;value;longitude;latitude;value;value value;value;longitude;latitude;value;value So everything that isn't inside several latitude, and longitude intervals should be deleted from the file. for f in *.out do for each line in $f: if not longitude >=

Android Api 8. Get x and y from a View, and Set x and y on a Button

时间秒杀一切 提交于 2019-12-04 05:18:19
问题 ­I'm coding with API 8. I need to get coordinates X and Y from a View and and set them as the coordinates of a new Button. I tried different ways but nothing works.... The setX and getX method works only from api level 11, I need a way to do that on API8. This is my method that allow to create a draggable copy of a button (this copy is an imageview and when I drop it became a new button) public boolean dragCopy(View view, MotionEvent me, Button bt){ int x,y,w,h,id,t,l; int cont=-1; int coord[

How to find correct neighbors for any giving coordinate?

戏子无情 提交于 2019-12-04 04:45:14
Update: this question is seeking guidance on how to get a set of neighbors for any given coordinate. I created a 2d array that contains coordinates, int[][] coordinates= { { -1, -1 }, { -1, 0 }, { -1, +1 }, { 0, -1 }, { 0, +1 }, { +1, -1 }, { +1, 0 }, { +1, -1 } }; As you can tell, these are the neighbors for coordinates (0,0). Now I am trying to implement a method that takes two parameters (int positionX, int positionY) , and use the input parameters value coordiante(x,y) as the starting coordinate and find all the neighbors for this coordinate. I am thinking about something like this: int

How can I sort a coordinate list for a rectangle counterclockwise?

霸气de小男生 提交于 2019-12-04 04:21:51
I need to sort a coordinate list for a rectangle counterclockwise, and make the north-east corner the first coordinate. These are geographic coordinates (i.e. Longitude, Latitude) in decimal form. 1 For example, here are the 4 corners of a rectangle, starting with the north-west corner and moving clockwise: [ { "lat": 34.495239, "lng": -118.127747 }, # north-west { "lat": 34.495239, "lng": -117.147217 }, # north-east { "lat": 34.095174, "lng": -117.147217 }, # south-east { "lat": 34.095174, "lng": -118.127747 } # south-west ] I need to sort these counterclockwise and change the "anchor"

Matching degree-based geographical coordinates with a regular expression

ぐ巨炮叔叔 提交于 2019-12-04 04:02:03
问题 I'd like to be able to identify patterns of the form 28°44'30"N., 33°12'36"E. Here's what I have so far: use utf8; qr{ (?: \d{1,3} \s* ° \s* \d{1,2} \s* ' \s* \d{1,2} \s* " \s* [ENSW] \s* \.? \s* ,? \s* ){2} }x; Needless to say, this doesn't match. Does it have anything to do with the extended characters (namely the degree symbol)? Or am I just screwing this up big time? I'd also appreciate directions to CPAN , if you know of something there that will solve my problem. I've looked at Regex:

OverPass API - SpeedLimit around a co-ordinates

ぐ巨炮叔叔 提交于 2019-12-04 04:01:03
问题 We are developing an application, that needs to find the speed around a specific location... We were planning to use OverPass API to first the speed and tried to follow the article mentioned below. Overpass api to find the speed limit for a co-ordinate? The syntax of the around method is shown below. http://www.overpass-api.de/api/xapi?*[maxspeed=*][around=2500,8.5580957,76.880541] But we are not getting any results... Can anyone guide us if the syntax is correct? 回答1: The failure reason:

Programmatically convert SVG shapes to paths (lineto, moveto)

半城伤御伤魂 提交于 2019-12-04 03:57:18
I have an SVG file coming from Inkscape, Illustrator, or any other application. I want to convert the shapes to lineto , moveto , curveto format. What I want is something like: ./Appname svgfile outfilewithpath I will give the SVG file as an argument, then my application will convert the object into the respective paths. Paul Sweatte Inkscape has a command-line interface. Use the Inkscape man page along with the verb source for reference: The ObjectToPath verb converts an object to a path: inkscape filename.svg --select=myobject --verb=ObjectToPath --export-plain-svg=filename_to_path.svg The

How to get the coordinates from layout from graphviz?

回眸只為那壹抹淺笑 提交于 2019-12-04 03:31:19
问题 I have been working with pygraph on some project. I completed this example, it works fine. Now, the problem is the following: the graph is drawn in a picture format (gif). What I need is to get the actual coordinates for each node for the graph layout shown on the gif image. How do I do this? I've been trying and trying, but couldn't find solution to this problem. I thought the the problem's solution would be somehow with manipulating one of the two following lines: gv.layout(gvv,'dot') gv