Select to view content in your preferred language

Displaying 1-to-many relationship in Javascript

3519
2
04-21-2015 08:32 AM
KeithWeber1
Deactivated User

Hello,

Description of data

The data being collected is environmental data from one device with multiple sensors. There is one location and time stamp with multiple environmental measurements. For example, at 10:00 am on 1/1/15 at some coordinate, the temperature was x, the wind speed was y and the wind direction was z. Different devices collect different types of measurements. The way that the database schema is setup is to have a feature class containing points and a separate table for measurements, where there are multiple measurements per point.

Point Table

Point ID

Shape

TimeStamp

Measurement Table

Measurement ID

Measurement Type

Measurement Value

Measurement Units

Point ID

The two tables are linked using the Point ID.

Desired Functionality

My web application is a viewer into an archive of measurements. It's purpose is to allow the user to fill in some query criteria and subset the data that is in the view. An example query would be something like displaying all the points between date x and date y where wind speed was collected.

The problem

This would normally be handled simply by setting a definition expression like MeasurementTbl.MeasurementType = "wind speed", but the problem is that the spatial table containing the point has a 1-to-many relationship to the measurements table and when creating a join, the result is that only the first measurement record is paired with a point in the resulting layer. For example, for a point with two measurements, say wind speed and temperature, if temperature is the first record to be paired to the point record, the wind speed record is lost.

Any suggestions would be greatly appreciated!

0 Kudos
2 Replies
williamcarr
Frequent Contributor

Keith,

I think a relationship query is your answer. It will query your point for existing related records(and in my case display them in an attribute inspector).

This is the thread that helped me. Related table in Attribute Inspector

0 Kudos
KeithWeber1
Deactivated User

William,

Thanks for the info! I'll check it out and let you know how it works.

0 Kudos