Select to view content in your preferred language

Trouble with TimeExtent

1974
3
03-11-2012 12:32 PM
GordonGordon
New Contributor
Hi,
I am new to this ArcGIS platform. I am trying to use the "Make XY Event Layer" tool in ArcToolbox.

Geographic Coordinate System: GCS_WGS_1984
Datum:  D_WGS_1984
Prime Meridian:  Greenwich
Angular Unit:  Degree

when TimeExtent disabled features are in the right place (screenshot_1) and FullExtent of FeatureLayer is:
XMin: 115716.328446092
YMin: 69167.3639030093
XMax: 130316.86821459
YMax: 95787.5884387642

[ATTACH=CONFIG]12578[/ATTACH]

If TimeExtent enabled, features are in the wrong place (screenshot_2) and FullExtent of FeatureLayer is:
XMin: 30.35382
YMin: 59.7104
XMax: 30.6107
YMax: 59.9484

[ATTACH=CONFIG]12579[/ATTACH]

what am I doing wrong? What is the binding between TimeExtent and FullExtent?
0 Kudos
3 Replies
DominiqueBroux
Esri Frequent Contributor
Strange!

Your case looks very close of the interactive SDK sample, i.e. a base map layer in mercator projection and a feature layer in geographical coodinates.

The features should be returned by the server in mercator projection but it seems that in your case they are in geographical coordinates.

Could you give more info on how to reproduce this issue?

Thanks
0 Kudos
by Anonymous User
Not applicable
Original User: GordonFreeMan

It's true.
Base map layer in mercator projection and a feature layer in geographical coodinates. I simply don't understand how TimeExtent affects mercator projection. :confused:
I use the API version 2.2.0.629 and ArcGIS Desktop 10.

Screenshots and the source code below:

<UserControl x:Class="Retrospective.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client" 
    xmlns:Toolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit;assembly=ESRI.ArcGIS.Client.Toolkit" 
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        <esri:Map x:Name="MyMap" TimeExtent="{Binding ElementName=MyTimeSlider, Path=Value}">
            
            <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" />

            <esri:FeatureLayer ID="vbLayer" Url="http://vmxp/ArcGIS/rest/services/vbgis/MapServer/0"                                                            
                               UpdateCompleted="FeatureLayer_UpdateCompleted"/>
        </esri:Map>

        <Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="50,10,50,10" >
            <Rectangle Fill="#77919191" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Border Background="#FFFFFFFF" BorderBrush="DarkGray" CornerRadius="5" Margin="10,10,10,15"
                   HorizontalAlignment="Center" VerticalAlignment="Top" >
                <StackPanel Margin="5">
                    <TextBlock Text="VBs" FontSize="16" HorizontalAlignment="Center"/>

                    <Grid>
                        <TextBlock 
                        Text="{Binding ElementName=MyMap, Path=Layers[vbLayer].TimeExtent.Start, Mode=OneWay}" 
                        HorizontalAlignment="Left" />
                        <TextBlock
                        Text="{Binding ElementName=MyMap, Path=Layers[vbLayer].TimeExtent.End, Mode=OneWay}" 
                        HorizontalAlignment="Right" />
                    </Grid>

                    <Toolkit:TimeSlider x:Name="MyTimeSlider" 
                        Loop="True" PlaySpeed="0:0:0.15"
                        TimeMode="TimeExtent"                 
                        MinimumValue="{Binding ElementName=MyMap, Path=Layers[vbLayer].TimeExtent.Start, Mode=OneWay}"
                        MaximumValue="{Binding ElementName=MyMap, Path=Layers[vbLayer].TimeExtent.End, Mode=OneWay}"                                
                        Value="2000/08/04 01:00:00 UTC,2000/08/07 01:00:00 UTC"
                        Height="20" />
                </StackPanel>
            </Border>
        </Grid>
    </Grid>
</UserControl>


namespace Retrospective
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            MouseRightButtonDown += new MouseButtonEventHandler(MainPage_MouseRightButtonDown);
        }

        void MainPage_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
//            (MyMap.Layers["vbLayer"] as FeatureLayer).Update();
//            (MyMap.Layers["vbLayer"] as FeatureLayer).Refresh();
            FeatureLayer featureLayer = (MyMap.Layers["vbLayer"] as FeatureLayer);
            
        }

        private void FeatureLayer_UpdateCompleted(object sender, EventArgs e)
        {
            TimeExtent extent = new TimeExtent(MyTimeSlider.MinimumValue, MyTimeSlider.MaximumValue);
            MyTimeSlider.Intervals = TimeSlider.CreateTimeStopsByTimeInterval(extent, new TimeSpan(0, 0, 10, 0, 0));
            MyTimeSlider.Value = new TimeExtent(MyTimeSlider.MinimumValue, MyTimeSlider.MinimumValue.AddMinutes(20));
        }
    }
}


TimeExtent is disabled:
[ATTACH=CONFIG]12639[/ATTACH]     [ATTACH=CONFIG]12640[/ATTACH]  

TimeExtent is enabled:
[ATTACH=CONFIG]12641[/ATTACH]     [ATTACH=CONFIG]12642[/ATTACH]

Properties: [ATTACH=CONFIG]12651[/ATTACH]


[TABLE="class: outer_border"]Layer: MyLayer (ID: 0)
Display Field: TIMEPOS

Type: Feature Layer

Geometry Type: esriGeometryPoint

Description:

Definition Expression:

Copyright Text:

Min. Scale: 0

Max. Scale: 0

Default Visibility: True

Extent:

XMin: 30.35382
YMin: 59.7104
XMax: 30.6107
YMax: 59.9484
Spatial Reference: 4326

Has Attachments: False

HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText

Time Info:

Start Time Field: TIMEDATA
End Time Field: N/A
Track ID Field: N/A
Time Extent: [2011/12/22 11:40:00 UTC, 2011/12/22 19:40:00 UTC]
Time Reference: N/A
Time Interval: 25 (esriTimeUnitsMinutes)
Export Options:

Use Time: True
Time Data Cumulative: False
Time Offset: 0

Drawing Info:

Renderer:

Simple Renderer:
Symbol:

Simple Marker Symbol:
Style: esriSMSCircle, Color: [0, 150, 70, 255], Size: 7, Angle: 0, XOffset: 0, YOffset: 0
Outline
Color: [0, 0, 0, 255], Width: 1
Label:
Description:

Transparency: 0
Labeling Info: N/A

Fields:
VEHICLE_ID (Type: esriFieldTypeInteger, Alias: VEHICLE_ID)
TIMEPOS (Type: esriFieldTypeString, Alias: TIMEPOS, Length: 512 )
TIMEDATA (Type: esriFieldTypeDate, Alias: TIMEDATA, Length: 36 )
LATITUDE (Type: esriFieldTypeDouble, Alias: LATITUDE)
LONGITUDE (Type: esriFieldTypeDouble, Alias: LONGITUDE)
SPEED (Type: esriFieldTypeInteger, Alias: SPEED)
AZIMUT (Type: esriFieldTypeInteger, Alias: AZIMUT)
FUELLEVELTIME (Type: esriFieldTypeDate, Alias: FUELLEVELTIME, Length: 36 )
STATETIME (Type: esriFieldTypeDate, Alias: STATETIME, Length: 36 )
FUELLEVEL (Type: esriFieldTypeInteger, Alias: FUELLEVEL)
STATE (Type: esriFieldTypeInteger, Alias: STATE)
IGNITIONTIME (Type: esriFieldTypeDate, Alias: IGNITIONTIME, Length: 36 )
IGNITION (Type: esriFieldTypeInteger, Alias: IGNITION)
INPUTALERTTIME (Type: esriFieldTypeDate, Alias: INPUTALERTTIME, Length: 36 )
OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID)
Shape (Type: esriFieldTypeGeometry, Alias: Shape)
Type ID Field: N/A

Supported Interfaces:   REST

Supported Operations:   Query

[/TABLE]
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Sorry I can't figure out where your issue could be:confused: As I am not able to reproduce, it's not that easy.

Two tests that might give a clue:

1) Could you try to set the map extent in Mercator coordinates

Something like:
  <esri:Map x:Name="MyMap" WrapAround="True">
   <esri:Map.Extent>
     <esri:Envelope XMin="-15000000" YMin="2000000" XMax="-7000000" YMax="8000000">
       <esri:Envelope.SpatialReference>
         <esri:SpatialReference WKID="102100"/>
       </esri:Envelope.SpatialReference>
     </esri:Envelope>
   </esri:Map.Extent>
  ......


2) Could you try with ArcGIS SL 2.4 version?
By chance this might have been fixed in the latest version.


Thanks
0 Kudos