How to extract wkt string from kml file C# - c#

So I’m trying to use ArcGIS Runtime to import and export kml files from a basic map control. I have the export working and I only now have to extract data from the kml file to draw a geometry on the map control.
I am only supporting line, points and polygons. Also single geometries only.
Do I simply try and use linq expressions to walk through the kml file and extract what I need? For example, if it’s a line, point or polygon and then create the WKT string from the coordinates and the shape information? I don’t want to use any third party tools but I can seem to see any relevant examples in the ArcGIS Runtime .NET examples.

Related

How to plot strings to corresponding coordinates for printing?

My company gave me a project to automate the distribution of OR (Official Receipt).
My task is to create an application where the user will encode the OR information and the application will then print the OR (via printer). My problem is, the paper they'll print it on already has the layout. All I need to do is embed the encoded values from my application into that layout with the correct coordinates.
How can I achieve this using .NET Framework?
I already tried searching for Graphic.DrawString, but my major problem is plotting the correct coordinates for each value.
Thank You.
Is the layout the users have the same for all users or can it change?
i.e.
If "Receipt#" is at location 20,20 on one clients receipt will it be at the same location on the rest?
If the same location - use trial and error as Tomek suggests, if it is not then you will need to have a program to scan the receipt to an image and then parse the image for the words you are after.
Are the data headings the same for all users or can that change too?
i.e.
Do all clients have Receipt# on their receipts or can another client have ReceptNo instead?
If this is the case you not only need to parse for the easy headings but you now need to parse for the text and understand it via mappings.
Unless you are really good with image manipulation/parsing you will need to load the receipts into an OCR tool, or better yet convert into a PDF. The PDF will hold the names of the text as well as the locations of the text as meta data and can be parsed into your mapping file.

How to extract geometric positions from 2d .dwg using Forge AutoDesk APIs?

Using Model derivative API I am able to get geometric properties of 3d dwg file but for 2d dwg I am facing the issue(Unrecoverable exit code from extractor: -1073741831) on extracting geometric properties.
I also understand that model derivative API doesn't provide a support for extracting 2d geometries.
Is any other way to extract geometry of 2d file using programming API(c#)?
EDIT
I have added ObjectTree JSON file and POST URL of "Extract Geometry for Selected Objects into an OBJ File" in the following GitHub link.
https://github.com/Jothipandiyan-jp1/Autodesk
From the error, it seems that your 2D drawing is somehow broken, or not uploaded right. Or is it a vertical file, like Plant 3D or Map 3D?
The Model Derivative should extract the 2D View, you can try the file on A360 Viewer or via API at this sample (C# source).
EDIT
From the comments, it seems you are trying to extract the .obj from a single objectId in the 2D DWG. This should not trigger errors, but it may return empty file as the OBJ format is intended for 3D shapes. Can you update your question with the full POST job used on your code? Make sure the modelGuid and objectIds parameters are correct.

Comparing Two PDFs, Outputting the highlighted differences back in the same pdf

I was able to extract the text from ghost script and was able to compare phrases of text at a time. However the problem was the ghost script output the text in a funky way. I was looking to compare elements by elements (Tables,Text,Images).I am looking to come up with an automated solution to do this. Im looking in to Itextsharp but couldn't find any documentations.
My biggest challenge is iterating through elements and comparing them with in the two PDFs.
Can anyone assist ?
The solution could be
use iTextSharp to extract images and text separately
compare text using google-diff-match-patch (it is available for both C# and Python)
compare extracted images using histograms or even some simple way like this one based on pixels comparision
Tables are not separate objects in PDF but just text objects + lines (or even just a background image with a grid). If you are looking to work with tables then you may be interested to check paid PDF Extractor SDK from ByteScout or open-source Tabula-extractor project which are both capable of detecting and extracting tables.
Disclosure: I'm affiliated with ByteScout

Add only some polylines from Kml file

I developed a Windows Store application with Bing Maps. I have to add polylines from kml file to the map but only the polylines that are inside a specific radius from my position.
Now I use the library SharpKml to parse the files and add all the polylines.
How can I add only some lines?
Thanks!
Assuming there is some piece of metadata available in the KML file, you can then filter the lines based on that information.

KML to google maps

I have a KMZ file containing an animation for google earth.
the KMZ contains KML with and a series of PNGs to overlay in a latlng boundary.
I want to 'port' this to google map api, but some tags (timespan importantly) are unsupported.
What is the most painless way to start accomplishing this task?
You might try taking a look at geoxml. It supports a different KML subset to GGeoXml. Unfortunately, there doesn't appear to be any documentation for it, so you'd have to just try it and see what happens. Although the project has an open source licence, the source code doesn't actually appear to be available, so you can't add the tags you need if they turn out not to be supported.

Categories

Resources