comparison cmd/bottlenecks/main.go @ 575:5484558e1b50

Fixed statements to insert bottlenecks.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 05 Sep 2018 18:11:50 +0200
parents 18c007104106
children d5626dd370a4
comparison
equal deleted inserted replaced
574:18c007104106 575:5484558e1b50
28 limiting, 28 limiting,
29 date_info, 29 date_info,
30 source_organization 30 source_organization
31 ) VALUES( 31 ) VALUES(
32 $1, 32 $1,
33 $2, 33 isrs_fromText($2),
34 $3, 34 $3,
35 $4, 35 $4,
36 isrsrange(isrs_fromText($5), isrs_fromText($6)), 36 isrsrange(isrs_fromText($5), isrs_fromText($6)),
37 ST_MakePolygon(ST_GeomFromText('LINESTRING(0 0,1 0,1 1,0 0)', 4326))::Geography, 37 ST_MakePolygon(ST_GeomFromText('LINESTRING(0 0,1 0,1 1,0 0)', 4326))::Geography,
38 $7, 38 $7,
129 129
130 for i := range bns { 130 for i := range bns {
131 bn := bns[i] 131 bn := bns[i]
132 rb, lb := splitRBLB(bn.Rb_lb) 132 rb, lb := splitRBLB(bn.Rb_lb)
133 133
134 var limiting string 134 var limiting, country string
135 135
136 if bn.Limiting_factor != nil { 136 if bn.Limiting_factor != nil {
137 limiting = string(*bn.Limiting_factor) 137 limiting = string(*bn.Limiting_factor)
138 } 138 }
139 139
140 fmt.Printf("%s '%s' %s %s\n", bn.Fk_g_fid, bn.OBJNAM, rb, lb) 140 if bn.Responsible_country != nil {
141 country = string(*bn.Responsible_country)
142 }
143
144 fmt.Printf("%s '%s' %s %s\n", bn.Fk_g_fid, bn.OBJNAM, bn.From_ISRS, bn.To_ISRS)
141 145
142 if _, err := st.Exec( 146 if _, err := st.Exec(
143 bn.Bottleneck_id, 147 bn.Bottleneck_id,
144 bn.Fk_g_fid, 148 bn.Fk_g_fid,
145 bn.OBJNAM, 149 bn.OBJNAM,
146 bn.NOBJNM, 150 bn.NOBJNM,
147 bn.From_ISRS, bn.To_ISRS, 151 bn.From_ISRS, bn.To_ISRS,
148 rb, 152 rb,
149 lb, 153 lb,
150 bn.Responsible_country, 154 country,
151 revisitingTime(bn.Revisiting_time), 155 revisitingTime(bn.Revisiting_time),
152 limiting, 156 limiting,
153 bn.Date_Info, 157 bn.Date_Info,
154 bn.Source, 158 bn.Source,
155 ); err != nil { 159 ); err != nil {