【问题标题】:VRT file format for CSV with gx_location and dollar amounts - GME带有 gx_location 和美元金额的 CSV 的 VRT 文件格式 - GME
【发布时间】:2013-11-19 22:21:58
【问题描述】:

我有一个包含 gx_location、整数和美元金额列的 CSV。在上传到 Google Maps Engine 时,我无法确定伴随此文件的正确 VRT,因此美元金额在 GME 中正确显示。

CSV 看起来像:

Name,gx_location,Units,Sales,Hour,TotalUnits,TotalSales
store #1,SPRINGFIELD VA 22150,1,"1,269.00",0:00:00,29,"16,424.00"
store #2,ATLANTA GA 30354,2,587.00,0:00:00,5,"1,865.00"

VRT 看起来像:

<OGRVRTDataSource>
    <OGRVRTLayer name="a00">
    <SrcDataSource relativeToVrt="1">a00.csv</SrcDataSource>
    <GeometryType>wkbPoint</GeometryType>
    <GeometryField reportSrcColumn="false" encoding="WKB" field="gx_location" />
    <LayerSRS>WGS84</LayerSRS>
      <Field name="Name" src="Name" type="String" />
      <Field name="gx_location" src="gx_location" type="String" />
      <Field name="Units" src="Units" type="Integer" />
      <Field name="Sales" src="Sales" type="Real" precision="2" />
      <Field name="Hour" src="Hour" type="String" />
      <Field name="TotalUnits" src="TotalUnits" type="Integer" />
      <Field name="TotalSales" src="TotalSales" type="Real" precision="2" />
    </OGRVRTLayer>
</OGRVRTDataSource>

当它进入 Maps Engine 时,在“编辑矢量数据”页面中,它看起来像(想象一个表格。我使用了三个空格来分隔条目):

store #1   SPRINGFIELD VA 22150   1   1     0:00:00   29   16
store #2   ATLANTA GA 30354       2   587   0:00:00    5    1

我正在使用格式(逗号)加载美元金额,因为这是我希望在信息弹出窗口中使用的格式。另外,我想与该字段中的数字进行 (大于)比较。

提前感谢您的帮助。

【问题讨论】:

    标签: google-maps csv google-maps-engine


    【解决方案1】:

    问题在于引号中的格式化美元金额(“16,424.00”)。 似乎 GME 将其解释为字符串而不是实数或整数。 将其更改为 16424.00 可以使用真正的精度 2。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-09
      相关资源
      最近更新 更多