Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kml2gmt, add KEYS for reading #183

Closed
wants to merge 1 commit into from
Closed

kml2gmt, add KEYS for reading #183

wants to merge 1 commit into from

Conversation

joa-quim
Copy link
Member

Missed the reading KEY. Avoid some failing tests for external but still does't work. It now crashes at line 240 when trying to read from fp

while (fgets (line, GMT_BUFSIZ, fp)) {

because data is not it fp

@PaulWessel
Copy link
Member

There were no KEY for input because we are not using the GMT i/o system and hence all the stuff about memory and passing info cannot work. The input KML is not a GMT container.

@PaulWessel
Copy link
Member

I mean, the entire read section would have to use GMT_Get_Record and work with the trailing text part only. It will be a major rewrite. Do you have KML in memory that you need to pass into kml2gmt that way and cannot use a file?

@joa-quim
Copy link
Member Author

No, I'm just blindly converting all GMT modules to work from Julia.
But note that gmt2kml works (don't know what to do with the output, but it's there)

julia> D = gmt("pscoast -R-15/2/50/59:30 -Jm1i -M -W0.25p -Di");

julia> Dk = gmt2kml(D, F=:l, W=(1,:red))
1-element Array{GMT.GMTdataset,1}:
 GMT.GMTdataset(Array{Float64}(9222,0), Any["<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "<kml xmlns=\"https://www.opengis.net/kml/2.2\">", "\t<Document>", "\t\t<Style id=\"st-39008-0\">", "\t\t\t<IconStyle>", "\t\t\t\t<Icon>", "\t\t\t\t\t<href>https://maps.google.com/mapfiles/kml/pal4/icon57.png</href>", "\t\t\t\t</Icon>", "\t\t\t\t<scale>1</scale>", "\t\t\t\t<color>ff80c0ff</color>"  …  "\t\t\t\t\t-3.14053559167,54.5825131609,0", "\t\t\t\t\t-3.16556038758,54.5603112841,0", "\t\t\t\t\t-3.156099794,54.5977721828,0", "\t\t\t\t\t-3.14442664225,54.5866330968,0", "\t\t\t\t\t-3.14053559167,54.5825131609,0", "\t\t\t\t</coordinates>", "\t\t\t</LineString>", "\t\t</Placemark>", "\t</Document>", "</kml>"], "", Any[], "", "")

@PaulWessel PaulWessel changed the title gmt2kml, add KEYS for reading kml2gmt, add KEYS for reading Jan 6, 2019
@PaulWessel
Copy link
Member

Perhaps you should just delete this PR since there is much more to do than changing the KEYS. Maybe make it an issue instead?

@joa-quim
Copy link
Member Author

Opened #976 to keep track of this

@joa-quim joa-quim closed this Jun 17, 2019
@joa-quim joa-quim deleted the kml2gmt branch June 17, 2019 20:38
obaney pushed a commit to obaney/gmt that referenced this pull request Aug 18, 2021
Enable grdimage for file input. Passing in `xarray.DataArray` isn't working
because of some bugs in the GMT C API. This will require some work
on the GMT side before we can use it. 
Implement basic support for grdinfo as well for testing.

Starts to implement GenericMappingTools#124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants