0

I use the importer in Geoserver to import a KML-file. The KML looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:ns2="http://www.google.com/kml/ext/2.2" xmlns:ns3="http://www.w3.org/2005/Atom" xmlns:ns4="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
    <Document>
        <Schema name="plz5_1" id="plz5_1">
            <SimpleField type="string" name="PL_ID"/>
            <SimpleField type="string" name="PLB"/>
            <SimpleField type="string" name="DummyPLZ"/>
            <SimpleField type="double" name="PL_EWA_A_G"/>
            <SimpleField type="double" name="PL_MBA_A_H"/>
        </Schema>
        <Folder>
            <name>plz5</name>
            <Placemark id="plz5.1">
                <ExtendedData>
                    <SchemaData schemaUrl="#plz5_1">
                        <SimpleData name="PL_ID">01067</SimpleData>
                        <SimpleData name="PLB">0100</SimpleData>
                        <SimpleData name="DummyPLZ"></SimpleData>
                        <SimpleData name="PL_EWA_A_G">12196.0</SimpleData>
                        <SimpleData name="PL_MBA_A_H">7225.0</SimpleData>
                    </SchemaData>
                </ExtendedData>
                <Polygon>
                    <outerBoundaryIs>
                        <LinearRing>
                            <tessellate>1</tessellate>
                            <coordinates>13.736871,51.046691 13.736251,51.046722 13.734591,51.046542 13.734291,51.046429 13.733812,51.046253 13.733682,51.046911 13.733642,51.04713 13.732132,51.047099 13.730072,51.046703 13.728922,51.04642 13.728513,51.046261 13.728002,51.046062 13.726963,51.045699 13.726033,51.0451 13.725373,51.04473 13.724173,51.043971 13.723424,51.043417 13.723363,51.043372 13.722313,51.04436 13.721133,51.045272 13.720773,51.045804 13.720693,51.045921 13.719924,51.047221 13.719584,51.049059 13.719596,51.049223 13.719644,51.049689 13.719644,51.051039 13.719813,51.051588 13.719631,51.051685 13.719102,51.053068 13.717161,51.053639 13.715122,51.054365 13.71328,51.054797 13.710406,51.054967 13.710332,51.052713 13.709325,51.052592 13.708175,51.052321 13.707015,51.052038 13.705846,51.05168 13.705066,51.051321 13.704856,51.051798 13.703406,51.052561 13.701796,51.052859 13.700556,51.053061 13.698957,51.053431 13.696597,51.053839 13.694487,51.054232 13.693137,51.054589 13.692187,51.055261 13.691877,51.055989 13.691278,51.057748 13.690628,51.058889 13.690348,51.06001 13.690538,51.060788 13.690668,51.061083 13.690875,51.061558 13.691017,51.061891 13.692087,51.062558 13.693517,51.06307 13.694667,51.063267 13.696987,51.063896 13.698406,51.064247 13.700616,51.065037 13.701136,51.065258 13.699536,51.067139 13.700126,51.06807 13.700666,51.069878 13.701756,51.072216 13.702323,51.072933 13.703035,51.073836 13.704638,51.074657 13.705805,51.075248 13.706571,51.075587 13.707635,51.076057 13.709694,51.076457 13.712224,51.076606 13.715473,51.076327 13.716948,51.075825 13.718283,51.075366 13.719783,51.073807 13.72018,51.07325 13.721013,51.072086 13.723722,51.069927 13.725632,51.068829 13.727292,51.067589 13.729252,51.06561 13.731361,51.06244 13.731876,51.061582 13.731972,51.061422 13.732671,51.060258 13.734151,51.05845 13.736601,51.056231 13.739031,51.05535 13.739477,51.05522 13.73965,51.05517 13.74163,51.054781 13.743819,51.054771 13.74415,51.05477 13.746289,51.05485 13.746609,51.054129 13.746879,51.05292 13.746939,51.05229 13.7462,51.05097 13.74564,51.050349 13.74504,51.049342 13.74395,51.048351 13.74337,51.04758 13.742966,51.047133 13.74281,51.046962 13.74151,51.046451 13.74085,51.046161 13.740381,51.046493 13.739781,51.046832 13.739271,51.046771 13.738141,51.046809 13.736871,51.046691</coordinates>
                        </LinearRing>
                    </outerBoundaryIs>
                </Polygon>
            </Placemark>
            <Placemark id="plz5.2">
                <ExtendedData>
                    <SchemaData schemaUrl="#plz5_1">
                        <SimpleData name="PL_ID">01069</SimpleData>
                        <SimpleData name="PLB">0100</SimpleData>
                        <SimpleData name="DummyPLZ"></SimpleData>
                        <SimpleData name="PL_EWA_A_G">26248.0</SimpleData>
                        <SimpleData name="PL_MBA_A_H">13375.0</SimpleData>
                    </SchemaData>
                </ExtendedData>
                <Polygon>
                    <outerBoundaryIs>
                        <LinearRing>
                            <tessellate>1</tessellate>
                            <coordinates>13.728899,51.023279 13.729403,51.023713 13.730113,51.024644 13.730375,51.024863 13.727817,51.025396 13.723541,51.026228 13.722751,51.029738 13.726133,51.030732 13.727417,51.031359 13.727147,51.032087 13.726647,51.032512 13.725823,51.032891 13.724733,51.033402 13.724383,51.033734 13.723452,51.034188 13.722823,51.0345 13.721094,51.034962 13.719764,51.035561 13.71877,51.036067 13.718084,51.036423 13.716692,51.037076 13.715544,51.037621 13.713535,51.039043 13.712205,51.039722 13.713855,51.041251 13.715785,51.042517 13.716264,51.042831 13.717744,51.043891 13.718784,51.04433 13.719934,51.044441 13.721543,51.044231 13.722317,51.043866 13.723363,51.043372 13.723424,51.043417 13.724173,51.043971 13.725373,51.04473 13.726033,51.0451 13.726963,51.045699 13.728002,51.046062 13.728513,51.046261 13.728922,51.04642 13.730072,51.046703 13.732132,51.047099 13.733642,51.04713 13.733682,51.046911 13.733812,51.046253 13.734291,51.046429 13.734591,51.046542 13.736251,51.046722 13.736871,51.046691 13.738141,51.046809 13.739271,51.046771 13.739781,51.046832 13.740381,51.046493 13.74085,51.046161 13.74151,51.046451 13.74281,51.046962 13.742966,51.047133 13.74337,51.04758 13.74395,51.048351 13.74504,51.049342 13.74564,51.050349 13.7462,51.05097 13.746939,51.05229 13.746879,51.05292 13.746609,51.054129 13.746289,51.05485 13.747305,51.055067 13.748219,51.055262 13.751009,51.05594 13.751049,51.055948 13.754688,51.057169 13.755048,51.05699 13.755618,51.056341 13.756308,51.055601 13.757028,51.055182 13.757115,51.055119 13.758208,51.054339 13.758426,51.053868 13.758641,51.053403 13.757911,51.051501 13.75779,51.0515 13.757376,51.050583 13.75717,51.04973 13.757329,51.049707 13.757068,51.048866 13.756227,51.047021 13.755257,51.046023 13.755048,51.04581 13.753879,51.044021 13.751799,51.041881 13.749209,51.039673 13.747088,51.038132 13.748696,51.037337 13.748966,51.036936 13.749138,51.036604 13.749175,51.036496 13.749224,51.036288 13.7488,51.035834 13.74861,51.035801 13.748629,51.035558 13.748702,51.035531 13.749374,51.034762 13.74939,51.034741 13.74938,51.034592 13.748174,51.033887 13.749114,51.032894 13.748304,51.032531 13.74596,51.033079 13.743444,51.032407 13.741914,51.032375 13.741011,51.032502 13.741091,51.031952 13.741481,51.030744 13.741281,51.029962 13.74139,51.028809 13.741418,51.028702 13.741129,51.028714 13.739791,51.028791 13.737754,51.028884 13.737484,51.026923 13.737386,51.026228 13.731863,51.026475 13.731961,51.025294 13.731742,51.024503 13.731589,51.022863 13.731502,51.021895 13.731193,51.021273 13.730377,51.020252 13.730263,51.019984 13.72961,51.019927 13.726013,51.019732 13.726334,51.02156 13.72753,51.022344 13.728899,51.023279</coordinates>
                        </LinearRing>
                    </outerBoundaryIs>
                </Polygon>
            </Placemark>
...

When imported, I notice that the available attributes in Geoserver are the following:

enter image description here

Where do attributes like adress, phoneNumber, description, Folder etc. come from? I did not provide them in the KML.

I am using Geoserver 2.7.2.

1

Those attributes come from the KML schema itself, I don't think the KML reader scans the whole file once to find which attributes are not null, to do a second pass for the actual import with just the attributes you specified. It can be made to do so of course, pull requests welcomed: https://github.com/geoserver/geoserver/blob/master/CONTRIBUTING.md

  • Thank you. Still wondering why the attributes are called phoneNumbe and descriptio, though. Seems a little weird to me. – hnrch Oct 17 '15 at 9:00
  • I would really like to contribute, but unfortunately my java skills are not sufficient I guess. – hnrch Oct 17 '15 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.