# How to convert data into dated entities?

**URL:** <https://community.wolfram.com/t/how-to-convert-data-into-dated-entities/16626>\
**Category:** Questions\
**Tags:** graphics-and-visualization, geography\
**Created:** [August 26, 2020, 12:49am UTC](https://community.wolfram.com/t/how-to-convert-data-into-dated-entities/16626 "2020-08-26T00:49:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![predecessor77](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/predecessor77/32/6262_2.png) [@predecessor77](https://community.wolfram.com/u/predecessor77)\
**Post date:** [August 26, 2020, 12:49am UTC](https://community.wolfram.com/t/how-to-convert-data-into-dated-entities/16626/1 "2020-08-26T00:49:22Z")

</div>

I have some environmental observe data, some examples are as follows:

```
data=<|DateObject[{2019,8,25,7,0,0.}]->{{DateObject[{2019,8,25,7,0,0.}],12.,{25.069,121.481}},{DateObject[{2019,8,25,7,0,0.}],13.,{25.0624,121.527}},{DateObject[{2019,8,25,7,0,0.}],13.,{24.2566,120.742}},{DateObject[{2019,8,25,7,0,0.}],8.,{24.9825,121.452}},{DateObject[{2019,8,25,7,0,0.}],9.,{25.0355,121.083}},{DateObject[{2019,8,25,7,0,0.}],14.,{24.7406,121.089}},{DateObject[{2019,8,25,7,0,0.}],18.,{24.9533,121.222}},{DateObject[{2019,8,25,7,0,0.}],9.,{24.697,120.899}},{DateObject[{2019,8,25,7,0,0.}],5.,{25.0465,121.508}},{DateObject[{2019,8,25,7,0,0.}],10.,{25.0206,121.53}},{DateObject[{2019,8,25,7,0,0.}],6.,{24.3829,120.759}},{DateObject[{2019,8,25,7,0,0.}],9.,{25.013,121.459}},{DateObject[{2019,8,25,7,0,0.}],2.,{24.9001,121.039}},{DateObject[{2019,8,25,7,0,0.}],5.,{25.0603,121.202}},{DateObject[{2019,8,25,7,0,0.}],4.,{25.05,121.579}},{DateObject[{2019,8,25,7,0,0.}],7.,{25.038,121.433}},{DateObject[{2019,8,25,7,0,0.}],4.,{25.0786,121.366}},{DateObject[{2019,8,25,7,0,0.}],9.,{24.5653,120.82}},{DateObject[{2019,8,25,7,0,0.}],8.,{25.017,121.516}},{DateObject[{2019,8,25,7,0,0.}],8.,{24.8639,121.216}},{DateObject[{2019,8,25,7,0,0.}],30.,{24.9957,121.304}},{DateObject[{2019,8,25,7,0,0.}],10.,{24.9542,121.205}},{DateObject[{2019,8,25,7,0,0.}],21.,{25.1059,121.515}}},
DateObject[{2019,8,25,8,0,0.}]->{{DateObject[{2019,8,25,8,0,0.}],13.,{24.9825,121.452}},{DateObject[{2019,8,25,8,0,0.}],10.,{24.5653,120.82}},{DateObject[{2019,8,25,8,0,0.}],13.,{24.9001,121.039}},{DateObject[{2019,8,25,8,0,0.}],8.,{25.013,121.459}},{DateObject[{2019,8,25,8,0,0.}],8.,{25.038,121.433}},{DateObject[{2019,8,25,8,0,0.}],5.,{25.0465,121.508}},{DateObject[{2019,8,25,8,0,0.}],9.,{24.697,120.899}},{DateObject[{2019,8,25,8,0,0.}],6.,{24.3829,120.759}},{DateObject[{2019,8,25,8,0,0.}],18.,{24.9533,121.222}},{DateObject[{2019,8,25,8,0,0.}],8.,{25.0603,121.202}},{DateObject[{2019,8,25,8,0,0.}],8.,{25.069,121.481}},{DateObject[{2019,8,25,8,0,0.}],11.,{24.7406,121.089}},{DateObject[{2019,8,25,8,0,0.}],18.,{25.1059,121.515}},{DateObject[{2019,8,25,8,0,0.}],21.,{24.8639,121.216}},{DateObject[{2019,8,25,8,0,0.}],10.,{25.017,121.516}},{DateObject[{2019,8,25,8,0,0.}],13.,{24.9542,121.205}},{DateObject[{2019,8,25,8,0,0.}],10.,{24.2566,120.742}},{DateObject[{2019,8,25,8,0,0.}],23.,{24.9957,121.304}},{DateObject[{2019,8,25,8,0,0.}],9.,{25.05,121.579}},{DateObject[{2019,8,25,8,0,0.}],5.,{24.9772,121.538}},{DateObject[{2019,8,25,8,0,0.}],11.,{25.0206,121.53}},{DateObject[{2019,8,25,8,0,0.}],13.,{25.0624,121.527}},{DateObject[{2019,8,25,8,0,0.}],6.,{25.0355,121.083}}},
DateObject[{2019,8,25,9,0,0.}]->{{DateObject[{2019,8,25,9,0,0.}],6.,{25.069,121.481}},{DateObject[{2019,8,25,9,0,0.}],7.,{25.0206,121.53}},{DateObject[{2019,8,25,9,0,0.}],9.,{25.038,121.433}},{DateObject[{2019,8,25,9,0,0.}],5.,{25.0465,121.508}},{DateObject[{2019,8,25,9,0,0.}],5.,{25.0355,121.083}},{DateObject[{2019,8,25,9,0,0.}],12.,{24.9001,121.039}},{DateObject[{2019,8,25,9,0,0.}],16.,{24.8639,121.216}},{DateObject[{2019,8,25,9,0,0.}],8.,{25.0624,121.527}},{DateObject[{2019,8,25,9,0,0.}],7.,{24.2566,120.742}},{DateObject[{2019,8,25,9,0,0.}],10.,{25.1059,121.515}},{DateObject[{2019,8,25,9,0,0.}],5.,{25.0603,121.202}},{DateObject[{2019,8,25,9,0,0.}],14.,{24.9533,121.222}},{DateObject[{2019,8,25,9,0,0.}],13.,{24.7406,121.089}},{DateObject[{2019,8,25,9,0,0.}],12.,{24.9542,121.205}},{DateObject[{2019,8,25,9,0,0.}],25.,{25.05,121.579}},{DateObject[{2019,8,25,9,0,0.}],10.,{25.017,121.516}},{DateObject[{2019,8,25,9,0,0.}],9.,{24.9825,121.452}},{DateObject[{2019,8,25,9,0,0.}],12.,{24.5653,120.82}},{DateObject[{2019,8,25,9,0,0.}],17.,{24.9772,121.538}},{DateObject[{2019,8,25,9,0,0.}],11.,{25.013,121.459}},{DateObject[{2019,8,25,9,0,0.}],9.,{24.697,120.899}},{DateObject[{2019,8,25,9,0,0.}],15.,{24.9957,121.304}},{DateObject[{2019,8,25,9,0,0.},
"Instant","Gregorian",8.],8.,{24.3829,120.759}}}|>;

```

I hope that Manipulate can display GeoDensityPlot based on time series.  
The document mentions that the data needs to be converted into a dated entity.  
I tried for a long time but failed~~  
How should I do it?

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [August 26, 2020, 1:49am UTC](https://community.wolfram.com/t/how-to-convert-data-into-dated-entities/16626/2 "2020-08-26T01:49:38Z")

</div>

Hi Tsai,

I don’t think `GeoDensityPlot` can plot time series data. Maybe you are trying to do this?

```
byDateAndPosition = Map[<|GeoPosition@Last@# -> #[[2]]|> &, data, {2}] // Map[Association]

Manipulate[GeoDensityPlot[byDateAndPosition[date]], {date, Keys@assoc}]

```

 ![7345plot.jpg](https://global.discourse-cdn.com/wolfram/original/2X/9/93527dfe7f51ef3b24953233a5e5a9043ffd659a.jpeg)

---

<div class="post-metadata">

**Author:** ![predecessor77](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/predecessor77/32/6262_2.png) [@predecessor77](https://community.wolfram.com/u/predecessor77)\
**Post date:** [August 26, 2020, 2:21am UTC](https://community.wolfram.com/t/how-to-convert-data-into-dated-entities/16626/3 "2020-08-26T02:21:37Z")

</div>

It should be that I did not express the problem clearly~~  
As you can see, I have time-series data for each observation point.  
I want to display the time series data of each observation point in the Manipulate and display GeoDensityPlot at the same time.  
In other words, DateListPlot and GeoDensityPlot can be synchronized.  
So I want to know how to establish a suitable data type to achieve the above goals.

Thanks for the example you provided, I will try it.  
I hope if it can succeed~~

---

<div class="post-metadata">

**Author:** ![anon21378091](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@anon21378091](https://community.wolfram.com/u/anon21378091)\
**Post date:** [August 26, 2020, 7:36pm UTC](https://community.wolfram.com/t/how-to-convert-data-into-dated-entities/16626/4 "2020-08-26T19:36:11Z")

</div>

Can you please explain in more detail?

There are 24 observation points, most of them have data values for three date/time, some have just two or one. So there are 24 time series. A `DateListPlot` will show 24 lines, each line connecting two or three points.. A `GeoDensityPlot` needs data values for several locations (observation points). In the `Manipulate` code above, the values for the selected day are used. What do you mean by

> DateListPlot and GeoDensityPlot can be synchronized

If you want the time series by observation point

```
Values[data] // Flatten[#, 1] & // GroupBy[Last -> Most] // KeyMap[GeoPosition]

```
