Select to view content in your preferred language

Can I create layer from sql?

3829
9
10-23-2013 11:06 AM
pf
by
Emerging Contributor
Hello,

I have a feature class in geobase which has about 1 300 000 features(objects/rows). And when I'm adding this feature class to map, the rendering takes a lot of time. So I want to limit this query(or filter). Definition query(in feature layer properties), and toolbox createFeatureLayer makes arcmap crash. So I wonder if I could query table to 150 objects, create emtpy feature class, add this 150 objects as features, and add this feature class to map. And how do this. I have some code, but it's not working.
0 Kudos
9 Replies
JeremieJoalland1
Deactivated User
If you only need visualisation (no edit), so you could query your database, then display your features as Graphic in a GraphicsLayer ?
It's pretty simple to use (see ArcGIS Runtime Java Samples)
0 Kudos
MarcoBoeringa
MVP Alum
Hello,

I have a feature class in geobase which has about 1 300 000 features(objects/rows). And when I'm adding this feature class to map, the rendering takes a lot of time. So I want to limit this query(or filter). Definition query(in feature layer properties), and toolbox createFeatureLayer makes arcmap crash. So I wonder if I could query table to 150 objects, create emtpy feature class, add this 150 objects as features, and add this feature class to map. And how do this. I have some code, but it's not working.


What version of ArcGIS and what database type and version are using (enterprise (e.g. Oracle) or file geodatabase)? Have you applied any available service packs for your release of ArcGIS?

There is no reason why ArcMap should crash setting a definition query on a 1.3M features Feature Class, it is just a SQL constraint that your RDBMS should be able to process fine. Just make sure the field(s) you use to filter / query the dataset, are indexed.

Have you checked the integrity of the features by using Check Geometry and Repair Geometry tools?
0 Kudos
pf
by
Emerging Contributor
What version of ArcGIS and what database type and version are using (enterprise (e.g. Oracle) or file geodatabase)? Have you applied any available service packs for your release of ArcGIS?

There is no reason why ArcMap should crash setting a definition query on a 1.3M features Feature Class, it is just a SQL constraint that your RDBMS should be able to process fine. Just make sure the field(s) you use to filter / query the dataset, are indexed.

Have you checked the integrity of the features by using Check Geometry and Repair Geometry tools?


I have ArcMap in version 10.2, and Oracle Database 11g Release 11.2.0.3.0 - 64bit Production. ArcMap crash and doesn't close, but it hangs up. Sometimes it shows features(after query definition), but still is not responding. Features are valid.
0 Kudos
pf
by
Emerging Contributor
If you only need visualisation (no edit), so you could query your database, then display your features as Graphic in a GraphicsLayer ?
It's pretty simple to use (see ArcGIS Runtime Java Samples)


Sounds good, but I have couple of questions:
1. I'm using java.sql to obtain data from DB. Is this good? Or should I use something more familiar with arcgis?
2. ArcGis Runtime Java Samples you mean this: http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualHelp/engine/index.html#/Samples/00010000042... ? I don't see there samples with GraphicsLayer, only with GraphicsContainer.
0 Kudos
MarcoBoeringa
MVP Alum
I have ArcMap in version 10.2, and Oracle Database 11g Release 11.2.0.3.0 - 64bit Production. ArcMap crash and doesn't close, but it hangs up. Sometimes it shows features(after query definition), but still is not responding. Features are valid.


Do the features have a proper spatial index? Is the data stored in Oracle Spatial or ST_Geometry? If the data is in Oracle Spatial, did you load it through ArcGIS or a third party tool? Are the fields you query on indexed?
0 Kudos
pf
by
Emerging Contributor
Field wchich I query are VARCHAR fields, and is not indexed. So my query looks like G5IDD LIKE '066201_1.0001%'. I have additional column, which is substring of G5IDD, so I don't have to user%. Features has a spatial index, default created by arcgis. Data is stored in ST_Geometry.
0 Kudos
MarcoBoeringa
MVP Alum
Field wchich I query are VARCHAR fields, and is not indexed. So my query looks like G5IDD LIKE '066201_1.0001%'. I have additional column, which is substring of G5IDD, so I don't have to user%.


I really think you need to index your fields as soon as you start querying them, especially with large amounts of features in your Feature Class.
0 Kudos
LeAnh1
by
Emerging Contributor
If you only need visualisation (no edit), so you could query your database, then display your features as Graphic in a GraphicsLayer ?
It's pretty simple to use (see ArcGIS Runtime Java Samples)


Thanks, but how to connect and query database?
0 Kudos
pf
by
Emerging Contributor
@mboeringa2010
I have index on varchar column, which doesn't speedup query. Problem was solved by teammate. When I will have more time, I will place our solution.
@12o0ney
Simply with ojdbc, not with arcobjects.
0 Kudos